这是我在 Global.asax 中的代码
WindsorContainer container = new WindsorContainer();
container.Register(Component.For(typeof(IRepository<>))
.ImplementedBy(typeof(NHRepository<>))
.LifeStyle.Transient)
我尝试将其翻译为 xml 配置文件,但没有成功
<component id="NHRepository"
service="NCommon.Data.IRepository'1, NCommon"
type="NCommon.Data.NHibernate.NHRepository'1, NCommon.NHibernate"
lifestyle="transient">
</component>
如何将此代码转换为配置文件中的 Windsor.config ?
坦克
米尔科
你需要使用反引号 http://en.wikipedia.org/wiki/Grave_accent, not 撇号 http://en.wikipedia.org/wiki/Apostrophe
<component id="NHRepository"
service="NCommon.Data.IRepository`1, NCommon"
type="NCommon.Data.NHibernate.NHRepository`1, NCommon.NHibernate"
lifestyle="transient">
</component>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)