Search Results for

    Show / Hide Table of Contents

    Class EndpointWithMapping<TRequest, TResponse, TEntity>

    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.

    Inheritance
    object
    BaseEndpoint
    Endpoint<TRequest, TResponse>
    EndpointWithMapping<TRequest, TResponse, TEntity>
    Implements
    IEndpoint
    IEventBus
    IServiceResolverBase
    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 EndpointWithMapping<TRequest, TResponse, TEntity> : Endpoint<TRequest, TResponse>, IEndpoint, IEventBus, IServiceResolverBase where TRequest : notnull
    Type Parameters
    Name Description
    TRequest

    the type of the request dto

    TResponse

    the type of the response dto

    TEntity

    the type of domain entity that will be mapped to/from

    Methods

    MapFromEntity(TEntity)

    override this method and place the logic for mapping a domain entity to a response dto

    Declaration
    public virtual TResponse MapFromEntity(TEntity e)
    Parameters
    Type Name Description
    TEntity e

    the domain entity to map from

    Returns
    Type Description
    TResponse

    MapFromEntityAsync(TEntity, CancellationToken)

    override this method and place the logic for mapping a domain entity to a response dto

    Declaration
    public virtual Task<TResponse> MapFromEntityAsync(TEntity e, CancellationToken ct = default)
    Parameters
    Type Name Description
    TEntity e

    the domain entity to map from

    CancellationToken ct

    a cancellation token

    Returns
    Type Description
    Task<TResponse>

    MapToEntity(TRequest)

    override this method and place the logic for mapping the request dto to the desired domain entity

    Declaration
    public virtual TEntity MapToEntity(TRequest r)
    Parameters
    Type Name Description
    TRequest r

    the request dto

    Returns
    Type Description
    TEntity

    MapToEntityAsync(TRequest, CancellationToken)

    override this method and place the logic for mapping the request dto to the desired domain entity

    Declaration
    public virtual Task<TEntity> MapToEntityAsync(TRequest r, CancellationToken ct = default)
    Parameters
    Type Name Description
    TRequest r

    the request dto to map from

    CancellationToken ct

    a cancellation token

    Returns
    Type Description
    Task<TEntity>

    Implements

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