Search Results for

    Show / Hide Table of Contents

    Interface IRequestBinder<TRequest>

    create custom request binders by implementing this interface. by registering a custom modelbinder for an endpoint will completely disable the built-in model binding and completely depend on your implementation of the custom binder to return a correctly populated request dto for the endpoint.

    Namespace: FastEndpoints
    Assembly: FastEndpoints.dll
    Syntax
    public interface IRequestBinder<TRequest>
    Type Parameters
    Name Description
    TRequest

    the type of the request dto

    Methods

    BindAsync(BinderContext, CancellationToken)

    this method will be called by the library for binding the incoming request data and return a populated request dto object. access the incoming request data via the RequestBinderContext and populate a new request dto instance and return it from this method.

    Declaration
    ValueTask<TRequest> BindAsync(BinderContext ctx, CancellationToken ct)
    Parameters
    Type Name Description
    BinderContext ctx

    request binder context encapsulating the incoming http request context, a list of validation failures for the endpoint, and an optional json serializer context.

    System.Threading.CancellationToken ct

    cancellation token

    Returns
    Type Description
    System.Threading.Tasks.ValueTask<TRequest>
    In This Article
    Back to top Developed by Đĵ ΝιΓΞΗΛψΚ and contributors / Licensed under MIT / Website generated by DocFX