接口拦截和构造函数有什么区别注入
asp.net
统一? 我缺乏与统一 我的老项目和unity.config工作,了解DI的一些类似这样的,Microsoft Unity接口拦截和构造函数的区别注入
<register type="ICRIC2012TrialUserService" mapTo="CRIC2012TrialUserService">
<lifetime type="perthread"/>
<interceptor type="InterfaceInterceptor"/>
<policyInjection/>
</register>
但一些不具备
<interceptor type="InterfaceInterceptor"/>
但在这些项目以同样的方法类和接口的工作,这样
private readonly IIncomingEstimateService _incomingEstimateService;
public ContractService(IIncomingEstimateService incomingEstimateService)
{
_incomingEstimateService = incomingEstimateService;
}
谢谢,这很有帮助。 – Bubble 2012-07-19 03:22:28