Search Results for

    Show / Hide Table of Contents

    Class Endpoint<TRequest, TResponse, TMapper>

    use this base class for defining endpoints that use both request and response dtos as well as require mapping to and from a domain entity using a seperate entity mapper.

    Inheritance
    object
    BaseEndpoint
    Endpoint<TRequest, TResponse>
    Endpoint<TRequest, TResponse, TMapper>
    Ep.Req<TRequest>.Res<TResponse>.Map<TMapper>
    Implements
    IEndpoint
    IEventBus
    IServiceResolverBase
    IHasMapper<TMapper>
    Inherited Members
    Endpoint<TRequest, TResponse>.HandleAsync(TRequest, CancellationToken)
    Endpoint<TRequest, TResponse>.ExecuteAsync(TRequest, CancellationToken)
    Endpoint<TRequest, TResponse>.TryResolve<TService>()
    Endpoint<TRequest, TResponse>.TryResolve(Type)
    Endpoint<TRequest, TResponse>.Resolve<TService>()
    Endpoint<TRequest, TResponse>.Resolve(Type)
    Endpoint<TRequest, TResponse>.CreateScope()
    Endpoint<TRequest, TResponse>.TryResolve<TService>(string)
    Endpoint<TRequest, TResponse>.TryResolve(Type, string)
    Endpoint<TRequest, TResponse>.Resolve<TService>(string)
    Endpoint<TRequest, TResponse>.Resolve(Type, string)
    Endpoint<TRequest, TResponse>.Route<T>(string, bool)
    Endpoint<TRequest, TResponse>.Query<T>(string, bool)
    Endpoint<TRequest, TResponse>.FormFileSectionsAsync(CancellationToken)
    Endpoint<TRequest, TResponse>.FormMultipartSectionsAsync(CancellationToken)
    Endpoint<TRequest, TResponse>.PublishAsync<TEvent>(TEvent, Mode, CancellationToken)
    Endpoint<TRequest, TResponse>.CreateTokenWith<TService>(string, Action<UserPrivileges>, TRequest)
    Endpoint<TRequest, TResponse>.ProcessorState<TState>()
    Endpoint<TRequest, TResponse>.OnBeforeValidate(TRequest)
    Endpoint<TRequest, TResponse>.OnBeforeValidateAsync(TRequest, CancellationToken)
    Endpoint<TRequest, TResponse>.OnAfterValidate(TRequest)
    Endpoint<TRequest, TResponse>.OnAfterValidateAsync(TRequest, CancellationToken)
    Endpoint<TRequest, TResponse>.OnBeforeHandle(TRequest)
    Endpoint<TRequest, TResponse>.OnBeforeHandleAsync(TRequest, CancellationToken)
    Endpoint<TRequest, TResponse>.OnAfterHandle(TRequest, TResponse)
    Endpoint<TRequest, TResponse>.OnAfterHandleAsync(TRequest, TResponse, CancellationToken)
    Endpoint<TRequest, TResponse>.OnValidationFailed()
    Endpoint<TRequest, TResponse>.OnValidationFailedAsync(CancellationToken)
    Endpoint<TRequest, TResponse>.User
    Endpoint<TRequest, TResponse>.Response
    Endpoint<TRequest, TResponse>.Config
    Endpoint<TRequest, TResponse>.Env
    Endpoint<TRequest, TResponse>.Logger
    Endpoint<TRequest, TResponse>.BaseURL
    Endpoint<TRequest, TResponse>.HttpMethod
    Endpoint<TRequest, TResponse>.Form
    Endpoint<TRequest, TResponse>.Files
    Endpoint<TRequest, TResponse>.ResponseStarted
    Endpoint<TRequest, TResponse>.SendAsync(TResponse, int, CancellationToken)
    Endpoint<TRequest, TResponse>.SendResultAsync(IResult)
    Endpoint<TRequest, TResponse>.SendInterceptedAsync(object, int, CancellationToken)
    Endpoint<TRequest, TResponse>.SendCreatedAtAsync<TEndpoint>(object, TResponse, Http?, int?, bool, CancellationToken)
    Endpoint<TRequest, TResponse>.SendCreatedAtAsync(string, object, TResponse, bool, CancellationToken)
    Endpoint<TRequest, TResponse>.SendAcceptedAtAsync<TEndpoint>(object, TResponse, Http?, int?, bool, CancellationToken)
    Endpoint<TRequest, TResponse>.SendAcceptedAtAsync(string, object, TResponse, bool, CancellationToken)
    Endpoint<TRequest, TResponse>.SendStringAsync(string, int, string, CancellationToken)
    Endpoint<TRequest, TResponse>.SendOkAsync(TResponse, CancellationToken)
    Endpoint<TRequest, TResponse>.SendOkAsync(CancellationToken)
    Endpoint<TRequest, TResponse>.SendErrorsAsync(int, CancellationToken)
    Endpoint<TRequest, TResponse>.SendNoContentAsync(CancellationToken)
    Endpoint<TRequest, TResponse>.SendNotFoundAsync(CancellationToken)
    Endpoint<TRequest, TResponse>.SendUnauthorizedAsync(CancellationToken)
    Endpoint<TRequest, TResponse>.SendForbiddenAsync(CancellationToken)
    Endpoint<TRequest, TResponse>.SendRedirectAsync(string, bool, bool)
    Endpoint<TRequest, TResponse>.SendHeadersAsync(Action<IHeaderDictionary>, int, CancellationToken)
    Endpoint<TRequest, TResponse>.SendBytesAsync(byte[], string, string, DateTimeOffset?, bool, CancellationToken)
    Endpoint<TRequest, TResponse>.SendFileAsync(FileInfo, string, DateTimeOffset?, bool, CancellationToken)
    Endpoint<TRequest, TResponse>.SendStreamAsync(Stream, string, long?, string, DateTimeOffset?, bool, CancellationToken)
    Endpoint<TRequest, TResponse>.SendEventStreamAsync<T>(string, IAsyncEnumerable<T>, CancellationToken)
    Endpoint<TRequest, TResponse>.SendEmptyJsonObject(CancellationToken)
    Endpoint<TRequest, TResponse>.AccessControl(string, Apply?, params string[])
    Endpoint<TRequest, TResponse>.AccessControl(string, params string[])
    Endpoint<TRequest, TResponse>.AllowAnonymous(params Http[])
    Endpoint<TRequest, TResponse>.AllowAnonymous(string[])
    Endpoint<TRequest, TResponse>.AllowFileUploads(bool)
    Endpoint<TRequest, TResponse>.AllowFormData(bool)
    Endpoint<TRequest, TResponse>.AuthSchemes(params string[])
    Endpoint<TRequest, TResponse>.Claims(params string[])
    Endpoint<TRequest, TResponse>.ClaimsAll(params string[])
    Endpoint<TRequest, TResponse>.Connect(params string[])
    Endpoint<TRequest, TResponse>.Connect(string, Expression<Func<TRequest, object>>)
    Endpoint<TRequest, TResponse>.Delete(params string[])
    Endpoint<TRequest, TResponse>.Delete(string, Expression<Func<TRequest, object>>)
    Endpoint<TRequest, TResponse>.Description(Action<RouteHandlerBuilder>, bool)
    Endpoint<TRequest, TResponse>.DontAutoSendResponse()
    Endpoint<TRequest, TResponse>.DontAutoTag()
    Endpoint<TRequest, TResponse>.DontCatchExceptions()
    Endpoint<TRequest, TResponse>.DontThrowIfValidationFails()
    Endpoint<TRequest, TResponse>.EnableAntiforgery()
    Endpoint<TRequest, TResponse>.Get(params string[])
    Endpoint<TRequest, TResponse>.Get(string, Expression<Func<TRequest, object>>)
    Endpoint<TRequest, TResponse>.Group<TEndpointGroup>()
    Endpoint<TRequest, TResponse>.Head(params string[])
    Endpoint<TRequest, TResponse>.Head(string, Expression<Func<TRequest, object>>)
    Endpoint<TRequest, TResponse>.Idempotency(Action<IdempotencyOptions>)
    Endpoint<TRequest, TResponse>.Options(Action<RouteHandlerBuilder>)
    Endpoint<TRequest, TResponse>.Options(params string[])
    Endpoint<TRequest, TResponse>.Options(string, Expression<Func<TRequest, object>>)
    Endpoint<TRequest, TResponse>.Patch(params string[])
    Endpoint<TRequest, TResponse>.Patch(string, Expression<Func<TRequest, object>>)
    Endpoint<TRequest, TResponse>.Permissions(params string[])
    Endpoint<TRequest, TResponse>.PermissionsAll(params string[])
    Endpoint<TRequest, TResponse>.Policy(Action<AuthorizationPolicyBuilder>)
    Endpoint<TRequest, TResponse>.Policies(params string[])
    Endpoint<TRequest, TResponse>.Post(params string[])
    Endpoint<TRequest, TResponse>.Post(string, Expression<Func<TRequest, object>>)
    Endpoint<TRequest, TResponse>.PostProcessor<TPostProcessor>()
    Endpoint<TRequest, TResponse>.PostProcessors(params IPostProcessor<TRequest, TResponse>[])
    Endpoint<TRequest, TResponse>.PreProcessor<TPreProcessor>()
    Endpoint<TRequest, TResponse>.PreProcessors(params IPreProcessor<TRequest>[])
    Endpoint<TRequest, TResponse>.Put(params string[])
    Endpoint<TRequest, TResponse>.Put(string, Expression<Func<TRequest, object>>)
    Endpoint<TRequest, TResponse>.RequestBinder(IRequestBinder<TRequest>)
    Endpoint<TRequest, TResponse>.ResponseCache(int, ResponseCacheLocation, bool, string, string[])
    Endpoint<TRequest, TResponse>.ResponseInterceptor(IResponseInterceptor)
    Endpoint<TRequest, TResponse>.Roles(params string[])
    Endpoint<TRequest, TResponse>.RoutePrefixOverride(string)
    Endpoint<TRequest, TResponse>.Routes(params string[])
    Endpoint<TRequest, TResponse>.SerializerContext<TContext>(TContext)
    Endpoint<TRequest, TResponse>.SerializerContext<TContext>()
    Endpoint<TRequest, TResponse>.Summary(Action<EndpointSummary>)
    Endpoint<TRequest, TResponse>.Summary(Action<EndpointSummary<TRequest>>)
    Endpoint<TRequest, TResponse>.Summary(EndpointSummary)
    Endpoint<TRequest, TResponse>.Tags(params string[])
    Endpoint<TRequest, TResponse>.Throttle(int, double, string)
    Endpoint<TRequest, TResponse>.Trace(params string[])
    Endpoint<TRequest, TResponse>.Trace(string, Expression<Func<TRequest, object>>)
    Endpoint<TRequest, TResponse>.Validator<TValidator>()
    Endpoint<TRequest, TResponse>.Verbs(params Http[])
    Endpoint<TRequest, TResponse>.Verbs(params string[])
    Endpoint<TRequest, TResponse>.Version(int, int)
    Endpoint<TRequest, TResponse>.ValidationFailed
    Endpoint<TRequest, TResponse>.AddError(ValidationFailure)
    Endpoint<TRequest, TResponse>.AddError(string, string, Severity)
    Endpoint<TRequest, TResponse>.AddError(Expression<Func<TRequest, object>>, string, string, Severity)
    Endpoint<TRequest, TResponse>.ThrowError(ValidationFailure, int?)
    Endpoint<TRequest, TResponse>.ThrowError(string, int?)
    Endpoint<TRequest, TResponse>.ThrowError(string, string, Severity, int?)
    Endpoint<TRequest, TResponse>.ThrowError(Expression<Func<TRequest, object>>, string, int?)
    Endpoint<TRequest, TResponse>.ThrowError(Expression<Func<TRequest, object>>, string, string, Severity, int?)
    Endpoint<TRequest, TResponse>.ThrowIfAnyErrors(int?)
    BaseEndpoint.Definition
    BaseEndpoint.HttpContext
    BaseEndpoint.ValidationFailures
    BaseEndpoint.Configure()
    BaseEndpoint.Verbs(params string[])
    BaseEndpoint.Routes(params string[])
    BaseEndpoint.Group<TEndpointGroup>()
    BaseEndpoint.GetAclHash(string)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: FastEndpoints
    Assembly: FastEndpoints.dll
    Syntax
    public abstract class Endpoint<TRequest, TResponse, TMapper> : Endpoint<TRequest, TResponse>, IEndpoint, IEventBus, IServiceResolverBase, IHasMapper<TMapper> where TRequest : notnull where TResponse : notnull where TMapper : class, IMapper
    Type Parameters
    Name Description
    TRequest

    the type of the request dto

    TResponse

    the type of the response dto

    TMapper

    the type of the entity mapper

    Properties

    Map

    the entity mapper for the endpoint

    HINT: entity mappers are singletons for performance reasons. do not maintain state in the mappers.

    Declaration
    public TMapper Map { get; set; }
    Property Value
    Type Description
    TMapper

    Methods

    SendMappedAsync<TEntity>(TEntity, int, CancellationToken)

    send a response by mapping the supplied entity using this endpoint's mapper's ASYNC mapping method.

    Declaration
    protected Task SendMappedAsync<TEntity>(TEntity entity, int statusCode = 200, CancellationToken ct = default)
    Parameters
    Type Name Description
    TEntity entity

    the entity instance to map to the response

    int statusCode

    the status code to send

    CancellationToken ct

    optional cancellation token

    Returns
    Type Description
    Task
    Type Parameters
    Name Description
    TEntity

    the type of the entity supplied

    SendMapped<TEntity>(TEntity, int, CancellationToken)

    send a response by mapping the supplied entity using this endpoint's mapper's SYNC mapping method.

    Declaration
    protected Task SendMapped<TEntity>(TEntity entity, int statusCode = 200, CancellationToken ct = default)
    Parameters
    Type Name Description
    TEntity entity

    the entity instance to map to the response

    int statusCode

    the status code to send

    CancellationToken ct

    optional cancellation token

    Returns
    Type Description
    Task
    Type Parameters
    Name Description
    TEntity

    the type of the entity supplied

    Implements

    IEndpoint
    IEventBus
    IServiceResolverBase
    IHasMapper<TMapper>
    In this article
    Back to top Developed by Đĵ ΝιΓΞΗΛψΚ and contributors / Licensed under MIT / Website generated by DocFX