Class ConsumerEndpoint<TEntity>
RPC endpoint that takes TEntity
as input when invoked.
public class ConsumerEndpoint<TEntity> : RpcEndpointBase, IConsumerEndpoint<TEntity>, IRpcEndpoint, IEndpoint
Type Parameters
TEntity
The type of entity the endpoint takes as input.
- Inheritance
-
ConsumerEndpoint<TEntity>
- Implements
-
IConsumerEndpoint<TEntity>
- Inherited Members
Constructors
ConsumerEndpoint(IEndpoint, string)
Creates a new action endpoint with a relative URI.
public ConsumerEndpoint(IEndpoint referrer, string relativeUri)
Parameters
referrer
IEndpointThe endpoint used to navigate to this one.
relativeUri
stringThe URI of this endpoint relative to the
referrer
's. Add a./
prefix here to imply a trailing slashreferrer
's URI.
ConsumerEndpoint(IEndpoint, Uri)
Creates a new action endpoint with a relative URI.
public ConsumerEndpoint(IEndpoint referrer, Uri relativeUri)
Parameters
referrer
IEndpointThe endpoint used to navigate to this one.
relativeUri
UriThe URI of this endpoint relative to the
referrer
's.
Methods
InvokeAsync(TEntity, CancellationToken)
Sends the entity to the consumer.
public Task InvokeAsync(TEntity entity, CancellationToken cancellationToken = default)
Parameters
entity
TEntityThe entity to post as input.
cancellationToken
CancellationTokenUsed to cancel the request.
Returns
Exceptions
- AuthenticationException
- UnauthorizedAccessException
- KeyNotFoundException
- HttpRequestException
Other non-success status code.