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.10.2
Syntax

[ObsoleteAttribute("Please use Lifestyle.Scoped.WhenScopeEnds(Container, Action) instead. Will be removed in version 5.0.", 
	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