Table of Contents

Class ConsumerEndpoint<TEntity>

Namespace
TypedRest.Endpoints.Rpc
Assembly
TypedRest.dll

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
Inherited Members

Constructors

ConsumerEndpoint(IEndpoint, string)

Creates a new action endpoint with a relative URI.

public ConsumerEndpoint(IEndpoint referrer, string relativeUri)

Parameters

referrer IEndpoint

The endpoint used to navigate to this one.

relativeUri string

The URI of this endpoint relative to the referrer's. Add a ./ prefix here to imply a trailing slash referrer's URI.

ConsumerEndpoint(IEndpoint, Uri)

Creates a new action endpoint with a relative URI.

public ConsumerEndpoint(IEndpoint referrer, Uri relativeUri)

Parameters

referrer IEndpoint

The endpoint used to navigate to this one.

relativeUri Uri

The 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 TEntity

The entity to post as input.

cancellationToken CancellationToken

Used to cancel the request.

Returns

Task

Exceptions

AuthenticationException

Unauthorized

UnauthorizedAccessException

Forbidden

KeyNotFoundException

NotFound or Gone

HttpRequestException

Other non-success status code.