SimpleInjectorUseOptionsAspNetCoreExtensionsUseMiddlewareTMiddleware Method

Simple Injector
Adds a middleware type to the application's request pipeline. The middleware will be resolved from Simple Injector. The middleware will be added to the container for verification.

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

public static void UseMiddleware<TMiddleware>(
	this SimpleInjectorUseOptions options,
	IApplicationBuilder app
)
where TMiddleware : class, IMiddleware

Parameters

options
Type: SimpleInjectorSimpleInjectorUseOptions
The SimpleInjectorUseOptions.
app
Type: IApplicationBuilder
The IApplicationBuilder instance.

Type Parameters

TMiddleware
The middleware type.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type SimpleInjectorUseOptions. 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).
See Also

Reference