Class PreProcessor<TRequest, TState>
inherit this class to create a pre-processor with access to the common processor state of the endpoint
Inherited Members
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public abstract class PreProcessor<TRequest, TState> : IPreProcessor<TRequest>, IPreProcessor where TState : class, new()
Type Parameters
Name | Description |
---|---|
TRequest | type of the request dto |
TState | type of the common processor state |
Methods
PreProcessAsync(IPreProcessorContext<TRequest>, TState, CancellationToken)
this method is called with the given arguments when the pre-processor executes.
Declaration
public abstract Task PreProcessAsync(IPreProcessorContext<TRequest> context, TState state, CancellationToken ct)
Parameters
Type | Name | Description |
---|---|---|
IPreProcessorContext<TRequest> | context | the context object encapsulating all necessary information for pre-processing. |
TState | state | the common processor state object |
CancellationToken | ct | cancellation token |
Returns
Type | Description |
---|---|
Task |