这是我用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?
坦克Mirko
发布于 2010-02-16 21:09:29
您需要使用backticks,而不是apostrophes
<component id="NHRepository"
service="NCommon.Data.IRepository`1, NCommon"
type="NCommon.Data.NHibernate.NHRepository`1, NCommon.NHibernate"
lifestyle="transient">
</component>https://stackoverflow.com/questions/2272104
复制相似问题