Class CommandMiddlewareConfig
command middleware configuration
Inherited Members
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public class CommandMiddlewareConfig
Methods
Register(params Type[])
register one or more open-generic command middleware pieces in the order you'd like them registered.
c.Register(typeof(CommandLogger<,>), typeof(CommandValidator<,>));
Declaration
public void Register(params Type[] middlewareTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| Type[] | middlewareTypes | the open-generic middleware types to add to the pipeline. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | thrown if any of the supplied types are not open-generic. |
Register<TCommand, TResult, TMiddleware>()
register a closed-generic command middleware in the pipeline.
Declaration
public void Register<TCommand, TResult, TMiddleware>() where TCommand : ICommand<TResult> where TMiddleware : ICommandMiddleware<TCommand, TResult>
Type Parameters
| Name | Description |
|---|---|
| TCommand | the type of the command |
| TResult | the type of the result |
| TMiddleware | the type of the middleware |