Implementing factories for Dependency Injection

With Dependency Injection you typically inject an instance through constructor or property. That means that the whole dependency tree is resolved at once. In some cases, however, it is not acceptable and you need to control the creation of object instances from inside of a class. That’s when the need for object factories arises. Instead … More Implementing factories for Dependency Injection

Creating .In and .NotIn extension methods for NHibernate 3 Linq provider

In Bringing the IN clause from SQL to C# I have shown how to create extension methods for C# that mimic the “in” clause from SQL. I like these methods a lot, but they cannot be used in Linq to NHibernate queries, because it cannot interpret them by default. Luckily, it’s not that hard to … More Creating .In and .NotIn extension methods for NHibernate 3 Linq provider