public SimpleInjectorServiceProvider(SimpleInjectorServiceProviderContainer container, Scope scope, bool ownsScope) { _container = container; _ownsScope = ownsScope; Scope = scope; _scopeId = ownsScope ? ++ScopeId : ScopeId; }
public void Dispose() { if (_ownsScope) { Scope?.Dispose(); _ownsScope = false; --ScopeId; } Scope = null; _container = null; _scopeId = 0; }