Tutorial by Examples

When registering types to the container Castle uses the type of the class in order to resolve. In the case that there is more than one registration for a specific type the Name property must be set: public void Install(IWindsorContainer container, IConfigurationStore store) { container.Regist...
A Lifestyle is the "how" Castle controls the scope in which a component is used and when to clean it up. The built-in lifestyles are Singelton, Transient, PerWebRequest, Scoped, Bound, PerThread and Pooled container.Register( Component.For<IFoo>() .ImplementedBy<...
The entire idea with dependency injection is that a class does not instantiate its dependencies but requests them (through constructor or property). Using Castle the way for specifying the way to resolve a dependency is by using the DependsOn: public class Foo : IFoo { public Foo(IBar bar, st...
When registering a component use the Interceptors() method to specify what are the interceptors/types of interceptors to be used for this component: The TInterceptor must implement the IInterceptor interface A single interceptor by type: container.Register( Component.For<MyInterceptor>...

Page 1 of 1