Inheritance – A horror story!

Let me start with stating that inheritance is not bad, in fact frankly I’m in love with it and use it a lot, but using it in the wrong places is like deciding to ride a motorbike in heavy snow with a warning of a tsunami triggered by an earthquake which is just refusing to…

Multi-Tenancy / Global Filters in Entity Framework

Multi-Tenancy / Global Filters in Entity Framework In this article I am going to describe a method to add global filters in Entity framework. The version I used for this example is 6.1 What does it do? Imagine that you have a multi-tenant database i.e. in a single database you have data for multiple tenants.…

C#: Dynamic Keyword: What, Why & When

What The “dynamic” keyword was first introduced in C# 4.0. It is used something like this: Using this you can even return anonymous .Net types (see the “When” section before you actually do this in production code): In the above code note that anonymous types are internal to an assembly, this means that if you…