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
    System.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>.Route<T>(String, Boolean)
    Endpoint<TRequest, TResponse>.Query<T>(String, Boolean)
    Endpoint<TRequest, TResponse>.FormFileSectionsAsync(CancellationToken)
    Endpoint<TRequest, TResponse>.PublishAsync<TEvent>(TEvent, Mode, CancellationToken)
    Endpoint<TRequest, TResponse>.CreateTokenWith<TService>(String, Action<UserPrivileges>)
    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, Int32, CancellationToken)
    Endpoint<TRequest, TResponse>.SendInterceptedAsync(Object, Int32, CancellationToken)
    Endpoint<TRequest, TResponse>.SendCreatedAtAsync<TEndpoint>(Object, TResponse, Nullable<Http>, Nullable<Int32>, Boolean, CancellationToken)
    Endpoint<TRequest, TResponse>.SendCreatedAtAsync(String, Object, TResponse, Boolean, CancellationToken)
    Endpoint<TRequest, TResponse>.SendStringAsync(String, Int32, String, CancellationToken)
    Endpoint<TRequest, TResponse>.SendOkAsync(TResponse, CancellationToken)
    Endpoint<TRequest, TResponse>.SendOkAsync(CancellationToken)
    Endpoint<TRequest, TResponse>.SendErrorsAsync(Int32, 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, Boolean, CancellationToken)
    Endpoint<TRequest, TResponse>.SendHeadersAsync(Action<IHeaderDictionary>, Int32, CancellationToken)
    Endpoint<TRequest, TResponse>.SendBytesAsync(Byte[], String, String, Nullable<DateTimeOffset>, Boolean, CancellationToken)
    Endpoint<TRequest, TResponse>.SendFileAsync(FileInfo, String, Nullable<DateTimeOffset>, Boolean, CancellationToken)
    Endpoint<TRequest, TResponse>.SendStreamAsync(Stream, String, Nullable<Int64>, String, Nullable<DateTimeOffset>, Boolean, CancellationToken)
    Endpoint<TRequest, TResponse>.SendEventStreamAsync<T>(String, IAsyncEnumerable<T>, CancellationToken)
    Endpoint<TRequest, TResponse>.SendEmptyJsonObject(CancellationToken)
    Endpoint<TRequest, TResponse>.AllowAnonymous(Http[])
    Endpoint<TRequest, TResponse>.AllowAnonymous(String[])
    Endpoint<TRequest, TResponse>.AllowFileUploads(Boolean)
    Endpoint<TRequest, TResponse>.AllowFormData()
    Endpoint<TRequest, TResponse>.AuthSchemes(String[])
    Endpoint<TRequest, TResponse>.Claims(String[])
    Endpoint<TRequest, TResponse>.ClaimsAll(String[])
    Endpoint<TRequest, TResponse>.Delete(String[])
    Endpoint<TRequest, TResponse>.Delete(String, Expression<Func<TRequest, Object>>)
    Endpoint<TRequest, TResponse>.Description(Action<RouteHandlerBuilder>, Boolean)
    Endpoint<TRequest, TResponse>.DontAutoTag()
    Endpoint<TRequest, TResponse>.DontCatchExceptions()
    Endpoint<TRequest, TResponse>.DontThrowIfValidationFails()
    Endpoint<TRequest, TResponse>.Get(String[])
    Endpoint<TRequest, TResponse>.Get(String, Expression<Func<TRequest, Object>>)
    Endpoint<TRequest, TResponse>.Group<TEndpointGroup>()
    Endpoint<TRequest, TResponse>.Head(String[])
    Endpoint<TRequest, TResponse>.Head(String, Expression<Func<TRequest, Object>>)
    Endpoint<TRequest, TResponse>.Options(Action<RouteHandlerBuilder>)
    Endpoint<TRequest, TResponse>.Patch(String[])
    Endpoint<TRequest, TResponse>.Patch(String, Expression<Func<TRequest, Object>>)
    Endpoint<TRequest, TResponse>.Permissions(String[])
    Endpoint<TRequest, TResponse>.PermissionsAll(String[])
    Endpoint<TRequest, TResponse>.Policy(Action<AuthorizationPolicyBuilder>)
    Endpoint<TRequest, TResponse>.Policies(String[])
    Endpoint<TRequest, TResponse>.Post(String[])
    Endpoint<TRequest, TResponse>.Post(String, Expression<Func<TRequest, Object>>)
    Endpoint<TRequest, TResponse>.PostProcessors(IPostProcessor<TRequest, TResponse>[])
    Endpoint<TRequest, TResponse>.PreProcessors(IPreProcessor<TRequest>[])
    Endpoint<TRequest, TResponse>.Put(String[])
    Endpoint<TRequest, TResponse>.Put(String, Expression<Func<TRequest, Object>>)
    Endpoint<TRequest, TResponse>.RequestBinder(IRequestBinder<TRequest>)
    Endpoint<TRequest, TResponse>.ResponseCache(Int32, ResponseCacheLocation, Boolean, String, String[])
    Endpoint<TRequest, TResponse>.ResponseInterceptor(IResponseInterceptor)
    Endpoint<TRequest, TResponse>.Roles(String[])
    Endpoint<TRequest, TResponse>.RoutePrefixOverride(String)
    Endpoint<TRequest, TResponse>.Routes(String[])
    Endpoint<TRequest, TResponse>.SerializerContext<TContext>(TContext)
    Endpoint<TRequest, TResponse>.Summary(Action<EndpointSummary>)
    Endpoint<TRequest, TResponse>.Summary(Action<EndpointSummary<TRequest>>)
    Endpoint<TRequest, TResponse>.Summary(EndpointSummary)
    Endpoint<TRequest, TResponse>.Tags(String[])
    Endpoint<TRequest, TResponse>.Throttle(Int32, Double, String)
    Endpoint<TRequest, TResponse>.Validator<TValidator>()
    Endpoint<TRequest, TResponse>.Verbs(Http[])
    Endpoint<TRequest, TResponse>.Verbs(String[])
    Endpoint<TRequest, TResponse>.Version(Int32, Nullable<Int32>)
    Endpoint<TRequest, TResponse>.ValidationFailed
    Endpoint<TRequest, TResponse>.AddError(String, String, Severity)
    Endpoint<TRequest, TResponse>.AddError(Expression<Func<TRequest, Object>>, String, String, Severity)
    Endpoint<TRequest, TResponse>.ThrowError(String)
    Endpoint<TRequest, TResponse>.ThrowError(Expression<Func<TRequest, Object>>, String)
    Endpoint<TRequest, TResponse>.ThrowIfAnyErrors()
    BaseEndpoint.Definition
    BaseEndpoint.HttpContext
    BaseEndpoint.ValidationFailures
    BaseEndpoint.Configure()
    BaseEndpoint.Verbs(String[])
    BaseEndpoint.Group<TEndpointGroup>()
    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 abstract class EndpointWithMapping<TRequest, TResponse, TEntity> : Endpoint<TRequest, TResponse>, IEndpoint, IEventBus, IServiceResolverBase
    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
    protected 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
    protected virtual Task<TResponse> MapFromEntityAsync(TEntity e, CancellationToken ct = default(CancellationToken))
    Parameters
    Type Name Description
    TEntity e

    the domain entity to map from

    System.Threading.CancellationToken ct

    a cancellation token

    Returns
    Type Description
    System.Threading.Tasks.Task<TResponse>

    MapToEntity(TRequest)

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

    Declaration
    protected 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
    protected virtual Task<TEntity> MapToEntityAsync(TRequest r, CancellationToken ct = default(CancellationToken))
    Parameters
    Type Name Description
    TRequest r

    the request dto to map from

    System.Threading.CancellationToken ct

    a cancellation token

    Returns
    Type Description
    System.Threading.Tasks.Task<TEntity>

    Implements

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