请教一个unity有关于泛型参数的问题
1个回答
展开全部
<register type="IRepository`1" mapTo="EdmRepository`1" name="edm"> <lifetime type="singleton" />
</register>
<register type="IPMP_TimeSheet_InfoServices" mapTo="PMP_TimeSheet_InfoServices">
<constructor>
<param name="_Repository">
<dependency name="edm"></dependency>
</param>
</constructor>
</register>
<register type="IRepository`1" mapTo="EdmRepository`1" name="edm"> <lifetime type="singleton" />
</register>
<register type="IPMP_TimeSheet_InfoServices" mapTo="PMP_TimeSheet_InfoServices">
<constructor>
<param name="_Repository">
<dependency name="edm"></dependency>
</param>
</constructor>
</register>
myUnityContainer.Resolve<PMP_TimeSheet_InfoServices>();
应该改成接口哦
myUnityContainer.Resolve<IPMP_TimeSheet_InfoServices>();
转载,仅供参考。
</register>
<register type="IPMP_TimeSheet_InfoServices" mapTo="PMP_TimeSheet_InfoServices">
<constructor>
<param name="_Repository">
<dependency name="edm"></dependency>
</param>
</constructor>
</register>
<register type="IRepository`1" mapTo="EdmRepository`1" name="edm"> <lifetime type="singleton" />
</register>
<register type="IPMP_TimeSheet_InfoServices" mapTo="PMP_TimeSheet_InfoServices">
<constructor>
<param name="_Repository">
<dependency name="edm"></dependency>
</param>
</constructor>
</register>
myUnityContainer.Resolve<PMP_TimeSheet_InfoServices>();
应该改成接口哦
myUnityContainer.Resolve<IPMP_TimeSheet_InfoServices>();
转载,仅供参考。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询