IM 使用 NCommon 和 NHibernate,并想使用 StruceMap 作为我的 IOC。没有人知道如何使用 StructureMap 注册 NCommon 吗?
这是关于 NCommon 的信息。
https://github.com/riteshrao/ncommon/
这是温莎城堡的做法
foreach (var type in types)
container.Register(Component.For<IController>().ImplementedBy(type)
.LifeStyle.Transient
.Named(type.Name.Replace("Controller", "")));
var containerAdapter = new NCommon.ContainerAdapter.CastleWindsor.WindsorContainerAdapter(container);