Sly has asked about the DependencyInjectionInterceptor class I referred to in a previous post.
Here is the class:
IKernel is the Castle Micro Kernel (within Windsor). Each entity (mapped class) needs to be registered in the container and must have an Id property.
One important ‘gotcha’ is that Castle will inject into public properties by default, so a class with a many-to-one will be given a default instance of the ‘one’ type by Castle, which you probably don’t want. The simplest way to stop this is to decorate the property with the DoNoWireAttribute in Castle.Core. There are other smarter ways.
As I mentioned in my reply to Sly, alternatives based on the latest NH release are described on NHForge.