WebRequestLifestyleWhenCurrentRequestEnds Method

Simple Injector

Note: This API is now obsolete.

Allows registering an action delegate that will be called when the scope ends, but before the scope disposes any instances.

Namespace:  SimpleInjector.Integration.Web
Assembly:  SimpleInjector.Integration.Web (in SimpleInjector.Integration.Web.dll) Version: 4.0.0
Syntax

[ObsoleteAttribute("WhenCurrentRequestEnds has been deprecated. Please use Lifestyle.Scoped.WhenScopeEnds(Container, Action) instead.", 
	true)]
[EditorBrowsableAttribute(EditorBrowsableState.Never)]
public static void WhenCurrentRequestEnds(
	Container container,
	Action action
)

Parameters

container
Type: SimpleInjectorContainer
The Container instance.
action
Type: SystemAction
The delegate to run when the scope ends.
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when one of the arguments is a null reference (Nothing in VB).
InvalidOperationExceptionWill be thrown when the current thread isn't running in the context of a web request.
See Also

Reference