private Scope GetScopeFromDefaultScopedLifestyle(Container container) { ScopedLifestyle lifestyle = container.Options.DefaultScopedLifestyle; if (lifestyle != null) { return(lifestyle.GetCurrentScope(container) ?? ThrowThereIsNoActiveScopeException()); } return(null); }
private Scope GetScopeFromDefaultScopedLifestyle(Container container) { ScopedLifestyle lifestyle = container.Options.DefaultScopedLifestyle; if (lifestyle != null) { return(lifestyle.GetCurrentScope(container) ?? ThrowThereIsNoActiveScopeException()); } return(container.GetVerificationOrResolveScopeForCurrentThread() ?? ThrowResolveFromScopeOrRegisterDefaultScopedLifestyleException()); }
private Scope GetScopeFromDefaultScopedLifestyle(Container container) { ScopedLifestyle lifestyle = container.Options.DefaultScopedLifestyle; if (lifestyle != null) { return(lifestyle.GetCurrentScope(container) ?? ThrowThereIsNoActiveScopeException()); } if (container.GetVerificationOrResolveScopeForCurrentThread() == null) { ThrowResolveFromScopeOrRegisterDefaultScopedLifestyleException(); } // We return null instead of one of the scope returned from the previous method call, // since the CreateCurrentScopeProvider contract states that we should return null. return(null); }
protected override Scope GetCurrentScopeCore(Container container) { ScopedLifestyle lifestyle = GetDefaultScopedLifestyle(container); return(lifestyle.GetCurrentScope(container)); }