Search Results for

    Show / Hide Table of Contents

    Class ResponseMapper<TResponse, TEntity>

    use this base class to define a domain entity mapper for your endpoints that only has a response dto and no request dto.

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

    Inheritance
    System.Object
    ResponseMapper<TResponse, TEntity>
    Implements
    IResponseMapper
    IMapper
    IServiceResolverBase
    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 abstract class ResponseMapper<TResponse, TEntity> : IResponseMapper, IMapper, IServiceResolverBase
    Type Parameters
    Name Description
    TResponse

    the type of response dto

    TEntity

    the type of domain entity to map to/from

    Methods

    CreateScope()

    use this base class to define a domain entity mapper for your endpoints that only has a response dto and no request dto.

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

    Declaration
    public IServiceScope CreateScope()
    Returns
    Type Description
    Microsoft.Extensions.DependencyInjection.IServiceScope

    FromEntity(TEntity)

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

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

    the domain entity to map from

    Returns
    Type Description
    TResponse

    FromEntityAsync(TEntity, CancellationToken)

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

    Declaration
    public virtual Task<TResponse> FromEntityAsync(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>

    Resolve(Type)

    use this base class to define a domain entity mapper for your endpoints that only has a response dto and no request dto.

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

    Declaration
    public object Resolve(Type typeOfService)
    Parameters
    Type Name Description
    System.Type typeOfService
    Returns
    Type Description
    System.Object

    Resolve<TService>()

    use this base class to define a domain entity mapper for your endpoints that only has a response dto and no request dto.

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

    Declaration
    public TService Resolve<TService>()
        where TService : class
    Returns
    Type Description
    TService
    Type Parameters
    Name Description
    TService

    TryResolve(Type)

    use this base class to define a domain entity mapper for your endpoints that only has a response dto and no request dto.

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

    Declaration
    public object TryResolve(Type typeOfService)
    Parameters
    Type Name Description
    System.Type typeOfService
    Returns
    Type Description
    System.Object

    TryResolve<TService>()

    use this base class to define a domain entity mapper for your endpoints that only has a response dto and no request dto.

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

    Declaration
    public TService TryResolve<TService>()
        where TService : class
    Returns
    Type Description
    TService
    Type Parameters
    Name Description
    TService

    Implements

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