private Scope GetCurrentScopeInternal(Container container) { // If we are running verification in the current thread, we prefer returning a verification scope // over a real active scope (issue #95). return(container.GetVerificationScopeForCurrentThread() ?? this.GetCurrentScopeCore(container)); }
/// <summary> /// Returns the current <see cref="Scope"/> for this lifestyle and the given /// <paramref name="container"/>, or null when this method is executed outside the context of a scope. /// </summary> /// <param name="container">The container instance that is related to the scope to return.</param> /// <returns>A <see cref="Scope"/> instance or null when there is no scope active in this context.</returns> public Scope GetCurrentScope(Container container) { Requires.IsNotNull(container, nameof(container)); // If we are running verification in the current thread, we prefer returning a verification scope // over a real active scope (issue #95). return(container.GetVerificationScopeForCurrentThread() ?? this.GetCurrentScopeCore(container)); }