StructureMap相当于CastleWindsor container.Release()方法

时间:2012-11-12 18:15:39

标签: .net dependency-injection castle-windsor structuremap

我正在尝试手动释放StructureMap创建的实例。在CastleWindsor中,可以这样做:

private readonly IWindsorContainer _container;

public void GetInstanceThenRelease(Type myType)
{
    var instance = (myType)this._container.Resolve(myType);
    this._container.Release(instance);
}

我如何在StructureMap中实现这一目标?

0 个答案:

没有答案