Class DomainEventMiddleware
- Namespace
- Signal.Application.Pipeline
- Assembly
- Signal.Application.dll
Publishes the envelope's domain event (ToDomainEvent()) to all registered IEventHandler<TEvent>s, then continues with command handling.
public sealed class DomainEventMiddleware : IMessageMiddleware
- Inheritance
-
DomainEventMiddleware
- Implements
- Inherited Members
Constructors
DomainEventMiddleware(IDomainEventDispatcher)
Publishes the envelope's domain event (ToDomainEvent()) to all registered IEventHandler<TEvent>s, then continues with command handling.
public DomainEventMiddleware(IDomainEventDispatcher dispatcher)
Parameters
dispatcherIDomainEventDispatcherThe event dispatcher of the message scope.
Methods
InvokeAsync(MessageContext, MessageDelegate)
Processes the message. Call next to continue; skip it to stop processing.
public Task InvokeAsync(MessageContext context, MessageDelegate next)
Parameters
contextMessageContextThe message being processed.
nextMessageDelegateThe rest of the pipeline.
Returns
- Task
A task that completes when this step (and everything it invoked) has finished.