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
ordispatcherOptions
are null
Methods
AddRoutes(IEndpointRouteBuilder)
Adds routes to the specified IEndpointRouteBuilder instance.
public void AddRoutes(IEndpointRouteBuilder endpoints)
Parameters
endpoints
IEndpointRouteBuilderThe 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
DispatchRequestThe incoming dispatcher request
mediator
IMediatorThe IMediator to send request to.
user
ClaimsPrincipalThe current security claims principal
cancellationToken
CancellationTokenThe cancellation token