SimpleInjectorUseOptionsAspNetCoreExtensionsUseSimpleInjector Method

Simple Injector
Finalizes the configuration of Simple Injector on top of IServiceCollection. Will ensure framework components can be injected into Simple Injector-resolved components, unless AutoCrossWireFrameworkComponents is set to false using the setupAction.

Namespace:  SimpleInjector
Assembly:  SimpleInjector.Integration.AspNetCore (in SimpleInjector.Integration.AspNetCore.dll) Version: 4.6.0
Syntax

public static IApplicationBuilder UseSimpleInjector(
	this IApplicationBuilder app,
	Container container,
	Action<SimpleInjectorUseOptions> setupAction = null
)

Parameters

app
Type: IApplicationBuilder
The application's IApplicationBuilder.
container
Type: SimpleInjectorContainer
The application's Container instance.
setupAction (Optional)
Type: SystemActionSimpleInjectorUseOptions
An optional setup action.

Return Value

Type: IApplicationBuilder
The supplied app.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IApplicationBuilder. 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
ArgumentNullExceptionThrown when app or container are null references.
See Also

Reference