Tag Archives: .NET

BIS Statistics F# Type Provider [alpha version]

The Bank for International Settlements (BIS) publishes statistics about the global financial system. The data is compiled in cooperation with central banks and other national authorities and provide information about financial stability. More information can be found on the BIS statistics website. Data exploration can be done either through the BIS Statistics Explorer, BIS Statistics… Read More »

My 2 Cents on Singleton

The implementation of the singleton pattern is pretty easy. However, despite the simplicity I see often that the pattern is being misused or implemented wrongly. What I’ve seen so far: The implementation is not thread-safe. (coding issue) Tight coupling: The business code/logic accesses a static property of a class in order to utilize the singleton… Read More »

IQueryable vs IEnumerable vs IHaveHeadache

Yes.. this ist just another blog post about IEnumerable and IQueryable. But the topic is quite important and I think it worth discussing about both approaches. Recently I had a discussion with a software architect about the implementation of the repository pattern. The question was: Should the repository return IEnumerable or IQueryable? So let’s do… Read More »

WCF Configuration for Large Data

In one of our projects we had to transfer large data from the server to the client WPF application. In the beginning we had some performance issues. Therefore we decided to do some comparisons between ASP.NET Web API, WCF (with and without protobuf-net). The configuration: ASP.NET Web API WCF (Protobuf) WCF – Protobuf serializer –… Read More »

C# Code Snippet for Unit Tests

After coding unit tests the whole day, I decided to create a nice Visual Studio snippet which helps me to write the test method quicker. I usually structure my unit tests like this: public void Validate_ReturnsFalse_WhenStringIsTooLong() { // Arrange var expectedResult = false; var watheverMock = new Mock<IWathever>(); // Act var validator = new Validator(watheverMock.Object);… Read More »

Entity Framework and Expression Queries

In my current project I had to generate a Entity Framework query based on some search criterias defined in a dictionary. The structure of the dictionary was similar to this example here: var searchCriteria = new Dictionary<string, List<string>>() { { "FirstName", new List<string> { "Darko", "NoName" } }, { "LastName", new List<string> { "Micic", "Müller",… Read More »

F# Journey: Course 3 – Functions

Back to: F# Journey: Course 2- Type Inference The concept of a function exists is in F# too. However, it’s slightly different than in C#. A F# function has a name, list of parameters and a return value. The function itself is assigned to a value with the “let” keyword. The parameter types are inferred… Read More »