请你帮我一个警告:
Warning CA2000 In method 'UnityConfig.UnityConfig()', object 'container'
is not disposed along all exception paths. Call System.IDisposable.Dispose on
object 'container' before all references to it are out of scope.
我的代码:
private static Lazy<IUnityContainer> container = new
Lazy<IUnityContainer>(() =>
{
var container = new UnityContainer();
RegisterTypes(container);
return container;
});
我有UnityWebApiActivator类和方法:
public static void Shutdown()
{
var container = UnityConfig.GetConfiguredContainer();
container.Dispose();
}