Data structures O(n) O(1)

Data structures and the principles behind them are something that every developer understands to some degree. However they are often forgotten. I was guilty of just such a thing recently when trying to write an import for some data from a CSV. The premise was fairly simple and the functions not complicated. However running it… Continue reading Data structures O(n) O(1)

Result Pattern

Previously I have always generated custom exceptions when I know that the state of the system will causes errors when running. Null checking method parameters at the start of a method being a simple example of this. I threw them up to be dealt with, or handled them in the catch locally. However recently I… Continue reading Result Pattern

Branching Pipelines with OWIN

Branching pipelines with OWIN allow for several different request pipelines to be used as needed depending on a determining factor. This factor is most often a Hostname but it could be any sort of toggle. An example might be authentication. Your system might need to allow for different authentication mechanisms for different users. The set… Continue reading Branching Pipelines with OWIN

Health checks in .netCore web APIs

Previously I have been writing health check controllers by hand. Now .netCore has a simple way of managing service health checks via middleware. You can test everything is operational all the way down to the database. You can even write your own custom checks in a few lines. A simple service operational health check can… Continue reading Health checks in .netCore web APIs

NUnit test cases

Testing multiple scenarios through the same function can be a bit of a time sink. Writing out a method for each scenario and just changing the data passed into the function then checking the output against the expected result. Steve Fenton showed me NUnit test cases the other day though which make running multiple permutations… Continue reading NUnit test cases

C# Interfaces and default method implementations

The upcoming C# 8.0 release came up the other day, or more specifically the inclusion of default implementations on interface methods. At first glance it seems akin to madness, blurring the line between implementation and inheritance. We already have abstract classes that cater for this, so why the need? Taking a little time to dig… Continue reading C# Interfaces and default method implementations