diff --git a/src/ServiceProvider.cs b/src/ServiceProvider.cs index 58a025b..7bbe24c 100644 --- a/src/ServiceProvider.cs +++ b/src/ServiceProvider.cs @@ -16,7 +16,7 @@ internal ServiceProvider(IUnityContainer container) { _container = container; _container.RegisterInstance(this, new ExternallyControlledLifetimeManager()); - _container.RegisterInstance(this, new ExternallyControlledLifetimeManager()); + _container.RegisterInstance(this, new ContainerControlledLifetimeManager()); _container.RegisterInstance(this, new ExternallyControlledLifetimeManager()); } @@ -73,12 +73,6 @@ public static explicit operator UnityContainer(ServiceProvider c) #region Disposable public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool _) { IDisposable disposable = _container; _container = null;