Closed li-zheng-hao closed 2 years ago
public class NeedCacheAttribute:Rougamo.MoAttribute,IDisposable { public void Dispose() { _scope.Dispose(); } private ILifetimeScope _scope { get; set; } }
用了autofac,需要在销毁的时候也调用一下scope销毁一些transient、scoped级别的对象,但是试了一下不会进入dispose方法,是什么原因呢?而且autofac的属性注入也无效(设置了public)
我的问题,加个析构函数等gc就可以了
用了autofac,需要在销毁的时候也调用一下scope销毁一些transient、scoped级别的对象,但是试了一下不会进入dispose方法,是什么原因呢?而且autofac的属性注入也无效(设置了public)