依存する2つのコントローラーがありますISomeService
public class FirstController
{
public FirstController(ISomeService someService)
{
}
}
public class SecondController
{
public SecondController(ISomeService someService)
{
}
}
ISomeServiceに依存する 1 つの実装がありますIRepository。
public class SomeService : ISomeService
{
public SomeService(IRepository repository)
{
}
}
IRepositoryには と の 2 つの実装がFirstRepositoryありSecondRepositoryます。
およびで 解決FirstControllerするようにコンテナーを構成するにはどうすればよいですか?FirstRepositorySecondControllerSecondRepository