Interface IEventHandler
Defines methods for publishing domain events.
Namespace: Innovt.Domain.Core.Events
Assembly: Innovt.Domain.Core.dll
Syntax
public interface IEventHandler
Methods
| Edit this page View SourcePublish(DomainEvent, CancellationToken)
Publishes a single domain event.
Declaration
Task Publish(DomainEvent domainEvent, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| DomainEvent | domainEvent | The domain event to be published. |
| CancellationToken | cancellationToken | The cancellation token to observe. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |
Publish(IEnumerable<DomainEvent>, CancellationToken)
Publishes a collection of domain events.
Declaration
Task Publish(IEnumerable<DomainEvent> domainEvents, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<DomainEvent> | domainEvents | The collection of domain events to be published. |
| CancellationToken | cancellationToken | The cancellation token to observe. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |