2012-05-13 70 views
3

不同的執行力度解決我有2個控制器,取決於ISomeService如何使用溫莎城堡

public class FirstController 
{ 
    public FirstController(ISomeService someService) 
    { 
    } 
} 

public class SecondController 
{ 
    public SecondController(ISomeService someService) 
    { 
    } 
} 

ISomeService有一個實現,這取決於IRepository

public class SomeService : ISomeService 
{ 
    public SomeService(IRepository repository) 
    { 
    } 
} 

IRepository有2個實現:FirstRepositorySecondRepository

如何配置容器以解決FirstControllerFirstRepositorySecondControllerSecondRepository

回答