ScopedLifestyleSetCurrentScope Method

Simple Injector
Sets the given scope as current scope in the given context. An existing scope will be overridden and not disposed of. If the overridden scope must be disposed of, this must be done manually.

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

public void SetCurrentScope(
	Scope scope
)

Parameters

scope
Type: SimpleInjectorScope
The current scope.
Exceptions

ExceptionCondition
NullReferenceExceptionThrown when scope is a null reference.
ArgumentExceptionThrown when the scope is not related to a Container.
NotSupportedExceptionThrown when the implementation does not support setting the current scope.
See Also

Reference