C# Performance Improvement Experience

I have a personal code originally wriiten in 10 years ago when I was starting coding in University. The code is basically stock price analysis tool.  Recently I started to look at it again and found a few tips to improve the performance calculation and DB access heavy code. Actually, this shouldn’t be DB access… Continue reading C# Performance Improvement Experience

Functional Principles in C# – method should be honest

Below are the key ideas of how to apply functional principles in C# explained in Pluralsight course by Vladimir Khorikov. Immutable Architecture Separate domain logic, Infrastructure(Persister), Service logic. Make the domain logic immutable and functional(input -> output) so as to easily unit test it. Make the infrastructure and service logic as simple as possible. Exception Use return… Continue reading Functional Principles in C# – method should be honest

Recursive mocking using Moq

Introduction When we want to mock a method that’s inside an interface which is inside another interface. This can go tricky. I’ll have a look at easy way mocking recursively using Moq. Prerequisite Moq mocking library ( Nuget package) Case There is a class having a dependency of IFoo interface, and IFoo contains IBar interface as… Continue reading Recursive mocking using Moq

SQLite in .Net

After using SQLite for a while, a few conclusions that I had were SQLite is quite stable enough to be used in corporate environment. SQLite is faster than SQLCE. For a SQLite admin, use the Firefox addon –  https://addons.mozilla.org/de/firefox/addon/sqlite-manager/ SQL Server Compact Toolbox will be useful: https://visualstudiogallery.msdn.microsoft.com/0e313dfd-be80-4afb-b5e9-6e74d369f7a1 Both SQLite and SQLCE cannot be used in a… Continue reading SQLite in .Net

CSV Library to use

At first, I used custom built CSV helper class, which simply separates CSV formatted string with a comma and push the data into DataTable. However, this class didn’t handle double quotation qualifier well enough. So, I started searching for a CSV library. One reliable and mostly recommended CSV library was A Fast CSV Reader (aka LumenWorks.Framework.IO) by Sebastien Lorion,… Continue reading CSV Library to use