Table of Contents

Class ConfigurableMiddleware<T, TOptions>

Namespace
Cuemon.AspNetCore
Assembly
Cuemon.AspNetCore.dll

Provides an base-class for configurable middleware implementation in ASP.NET Core that supports the options pattern with a dependency injected parameter.

public abstract class ConfigurableMiddleware<T, TOptions> : ConfigurableMiddlewareCore<TOptions>, IConfigurable<TOptions> where TOptions : class, IParameterObject, new()

Type Parameters

T

The type of the dependency injected parameter of InvokeAsync(HttpContext, T).

TOptions

The type of the options to setup.

Inheritance
Object
ConfigurableMiddleware<T, TOptions>
Implements
IConfigurable<TOptions>
Derived
Inherited Members

Constructors

ConfigurableMiddleware(RequestDelegate, IOptions<TOptions>)

Initializes a new instance of the ConfigurableMiddleware<TOptions> class.

protected ConfigurableMiddleware(RequestDelegate next, IOptions<TOptions> setup)

Parameters

next RequestDelegate

The delegate of the request pipeline to invoke.

setup IOptions<TOptions>

The Microsoft.Extensions.Options.IOptions<TOptions> which need to be configured.

ConfigurableMiddleware(RequestDelegate, Action<TOptions>)

Initializes a new instance of the ConfigurableMiddleware<TOptions> class.

protected ConfigurableMiddleware(RequestDelegate next, Action<TOptions> setup)

Parameters

next RequestDelegate

The delegate of the request pipeline to invoke.

setup Action<TOptions>

The System.Action<T> which need to be configured.

Methods

InvokeAsync(HttpContext, T)

public abstract Task InvokeAsync(HttpContext context, T di)

Parameters

context HttpContext

The context of the current request.

di T

The dependency injected parameter of InvokeAsync(HttpContext, T).

Returns

Task

A task that represents the execution of this middleware.

See Also