我有一个服务接口ICustomerService,并通过两种类型实现它:
public class CustomerService : ICustomerService
{
// stuff
}
public class CachedCustomerService : ICustomerService
{
public CachedCustomerService(CustomerService service) { }
}
然后缓存的服务只是缓存并委托给正常的服务。
对于注册,我让ICustomerService解析为CachedCustomerService,然后Custo