SimpleInjectorWebApiExtensionsGetCurrentHttpRequestMessage Method

Simple Injector
Retrieves the HttpRequestMessage instance for the current request.

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

public static HttpRequestMessage GetCurrentHttpRequestMessage(
	this Container container
)

Parameters

container
Type: SimpleInjectorContainer
The container.

Return Value

Type: HttpRequestMessage
The HttpRequestMessage for the current request.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Container. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions

ExceptionCondition
InvalidOperationExceptionThrown when this method is called before EnableHttpRequestMessageTracking(Container, HttpConfiguration) is called.
ArgumentNullExceptionThrown when the container argument is a null reference.
See Also

Reference