castle-windsor Fluent API Registration Registering Several Types of Same Interface


Example

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.Register(
        Component.For<IFoo>().ImplementedBy<Foo>().Named("Registration1"),
        Component.For<IBar>().ImplementedBy<Bar().Named("Registration2"));
}