Class EndpointWithoutRequest<TResponse, TMapper>
use this base class for defining endpoints that doesn't need a request dto but return a response dto and uses a response mapper.
Inheritance
System.Object
Endpoint<EmptyRequest, TResponse>
EndpointWithoutRequest<TResponse>
EndpointWithoutRequest<TResponse, TMapper>
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 EndpointWithoutRequest<TResponse, TMapper> : EndpointWithoutRequest<TResponse>, IEndpoint, IEventBus, IServiceResolverBase, IHasMapper<TMapper>, IHasMapper where TMapper : IResponseMapper
Type Parameters
Name | Description |
---|---|
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
SendMapped<TEntity>(TEntity, Int32, CancellationToken)
use this base class for defining endpoints that doesn't need a request dto but return a response dto and uses a response mapper.
Declaration
protected Task SendMapped<TEntity>(TEntity entity, int statusCode = 200, CancellationToken ct = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
TEntity | entity | |
System.Int32 | statusCode | |
System.Threading.CancellationToken | ct |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Type Parameters
Name | Description |
---|---|
TEntity |
SendMappedAsync<TEntity>(TEntity, Int32, CancellationToken)
use this base class for defining endpoints that doesn't need a request dto but return a response dto and uses a response mapper.
Declaration
protected async Task SendMappedAsync<TEntity>(TEntity entity, int statusCode = 200, CancellationToken ct = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
TEntity | entity | |
System.Int32 | statusCode | |
System.Threading.CancellationToken | ct |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Type Parameters
Name | Description |
---|---|
TEntity |