Class RequestBinder<TRequest>
the default request binder for a given request dto type
Inheritance
System.Object
RequestBinder<TRequest>
Implements
IRequestBinder<TRequest>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public class RequestBinder<TRequest> : IRequestBinder<TRequest>
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 async 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 |
System.Threading.CancellationToken | cancellation | cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<TRequest> |
Exceptions
Type | Condition |
---|---|
ValidationFailureException | thrown if any failures occur during the binding process |