Since version 3 of Simple Injector has a RegisterConditional method
container.RegisterConditional<IFooInterface, FooA>(c => c.Consumer.ImplementationType == typeof(ControllerA)); container.RegisterConditional<IFooInterface, FooB>(c => c.Consumer.ImplementationType == typeof(ControllerB)); container.RegisterConditional<IFooInterface, DefaultFoo>(c => !c.Handled);
Mikael chudinov
source share