3
这是我在Global.asax中的代码配置城堡Windosor和通用
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://stackoverflow.com/questions/934352/castle-windsor-fluent- api-define-array-with-single-item-as-dependency) – Ahmad 2010-02-16 11:05:07
不相关.... – 2010-02-16 13:07:51