我这样写了我的 CustomLifetimeManager:
public class CustomLifetimeManager <T> : LifetimeManager
{
private readonly string _arg;
public CustomLifetimeManager(string arg)
{
_arg = arg;
}
}
现在,以编程方式配置容器很容易,但是如何将它添加到配置文件中,如下所示?
<type type="myTime"
mapTo="myImpl">
<lifetime type="CustomLifetimeManager"/>
</type>