Table of Contents

Class DispatcherEndpoint

Namespace
Arbiter.CommandQuery.Endpoints
Assembly
Arbiter.CommandQuery.Endpoints.dll

Defines an endpoint for dispatching commands using the Mediator pattern.

public class DispatcherEndpoint : IEndpointRoute
Inheritance
DispatcherEndpoint
Implements
Inherited Members

Constructors

DispatcherEndpoint(ILogger<DispatcherEndpoint>, IOptions<DispatcherOptions>)

Initializes a new instance of the DispatcherEndpoint class.

public DispatcherEndpoint(ILogger<DispatcherEndpoint> logger, IOptions<DispatcherOptions> dispatcherOptions)

Parameters

logger ILogger<DispatcherEndpoint>

The logger for this feature endpoint

dispatcherOptions IOptions<DispatcherOptions>

The configuration options for the dispatcher

Exceptions

ArgumentNullException

When logger or dispatcherOptions are null

Methods

AddRoutes(IEndpointRouteBuilder)

Adds routes to the specified IEndpointRouteBuilder instance.

public void AddRoutes(IEndpointRouteBuilder endpoints)

Parameters

endpoints IEndpointRouteBuilder

The IEndpointRouteBuilder to add the route to.

Send(DispatchRequest, IMediator, ClaimsPrincipal?, CancellationToken)

Dispatches a request to the appropriate handler using the Mediator pattern.

protected virtual Task<IResult> Send(DispatchRequest dispatchRequest, IMediator mediator, ClaimsPrincipal? user = null, CancellationToken cancellationToken = default)

Parameters

dispatchRequest DispatchRequest

The incoming dispatcher request

mediator IMediator

The IMediator to send request to.

user ClaimsPrincipal

The current security claims principal

cancellationToken CancellationToken

The cancellation token

Returns

Task<IResult>

Awaitable task returning the mediator response