ScopedLifestyleGetCurrentScopeCore Method

Simple Injector
Returns the current Scope for this lifestyle and the given container, or null when this method is executed outside the context of a scope.

Namespace:  SimpleInjector
Assembly:  SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
Syntax

protected virtual Scope GetCurrentScopeCore(
	Container container
)

Parameters

container
Type: SimpleInjectorContainer
The container instance that is related to the scope to return.

Return Value

Type: Scope
A Scope instance or null when there is no scope active in this context.
Remarks

By default, this method calls the CreateCurrentScopeProvider(Container) method and invokes the returned delegate. This method can be overridden to provide an optimized way for getting the current scope.
See Also

Reference