我正在尝试手动释放StructureMap创建的实例。在CastleWindsor中,可以这样做:
private readonly IWindsorContainer _container;
public void GetInstanceThenRelease(Type myType)
{
var instance = (myType)this._container.Resolve(myType);
this._container.Release(instance);
}
我如何在StructureMap中实现这一目标?