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
Parameters
- scope
- Type: SimpleInjectorScope
The current scope.
Exceptions
Exception | Condition |
---|---|
NullReferenceException | Thrown when scope is a null reference. |
ArgumentException | Thrown when the scope is not related to a Container. |
NotSupportedException | Thrown when the implementation does not support setting the current scope. |
See Also