Class ConfigurableMiddleware<T1, T2, 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 two dependency injected parameters.
public abstract class ConfigurableMiddleware<T1, T2, TOptions> : ConfigurableMiddlewareCore<TOptions>, IConfigurable<TOptions> where TOptions : class, IParameterObject, new()
Type Parameters
T1The type of the first dependency injected parameter of InvokeAsync(HttpContext, T1, T2).
T2The type of the second dependency injected parameter of InvokeAsync(HttpContext, T1, T2).
TOptionsThe type of the options to setup.
- Inheritance
-
ConfigurableMiddlewareCore<TOptions>ConfigurableMiddleware<T1, T2, TOptions>
- Implements
-
IConfigurable<TOptions>
- Inherited Members
Constructors
ConfigurableMiddleware(RequestDelegate, IOptions<TOptions>)
Initializes a new instance of the ConfigurableMiddleware<TOptions> class.
protected ConfigurableMiddleware(RequestDelegate next, IOptions<TOptions> setup)
Parameters
nextRequestDelegateThe delegate of the request pipeline to invoke.
setupIOptions<TOptions>The 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
nextRequestDelegateThe delegate of the request pipeline to invoke.
setupAction<TOptions>The Action<T> which need to be configured.
Methods
InvokeAsync(HttpContext, T1, T2)
Executes the ConfigurableMiddleware<T1, T2, TOptions>.
public abstract Task InvokeAsync(HttpContext context, T1 di1, T2 di2)
Parameters
contextHttpContextThe context of the current request.
di1T1The first dependency injected parameter of InvokeAsync(HttpContext, T1, T2).
di2T2The second dependency injected parameter of InvokeAsync(HttpContext, T1, T2).
Returns
- Task
A task that represents the execution of this middleware.