Class RequestBinder<TRequest>
the default request binder for a given request dto type
Implements
IRequestBinder<TRequest>
Inherited Members
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public class RequestBinder<TRequest> : IRequestBinder<TRequest> where TRequest : notnull
Type Parameters
Name | Description |
---|---|
TRequest | the type of the request dto this binder will be dealing with |
Constructors
RequestBinder()
default constructor which enables all binding sources
Declaration
public RequestBinder()
RequestBinder(BindingSource)
constructor accepting a bitwise combination of enums which enables only the specified binding sources
Declaration
public RequestBinder(BindingSource enabledSources)
Parameters
Type | Name | Description |
---|---|---|
BindingSource | enabledSources | a bitwise combination of enum values |
Methods
BindAsync(BinderContext, CancellationToken)
override this method to customize the request binding logic
Declaration
public virtual ValueTask<TRequest> BindAsync(BinderContext ctx, CancellationToken cancellation)
Parameters
Type | Name | Description |
---|---|---|
BinderContext | ctx | the request binder context which holds all the data required for binding the incoming request |
CancellationToken | cancellation | cancellation token |
Returns
Type | Description |
---|---|
ValueTask<TRequest> |
Exceptions
Type | Condition |
---|---|
ValidationFailureException | thrown if any failures occur during the binding process |