I have 2 controllers that depend on ISomeService
public class FirstController
{
public FirstController(ISomeService someService)
{
}
}
public class SecondController
{
public SecondController(ISomeService someService)
{
}
}
ISomeService has one implementation, which depends on IRepository:
public class SomeService : ISomeService
{
public SomeService(IRepository repository)
{
}
}
IRepository has 2 implementations: FirstRepository and SecondRepository.
How can I configure container for resolving FirstController with FirstRepository and SecondController with SecondRepository?
You can register the 2 implementation with different names and then can pass the name while calling Resolve method. http://castleproject.org/container/documentation/trunk/manual/windsortypedocs/Generated_IWindsorContainer.html#IWindsorContainer_Methods5
Check this section in windsor docs