Interface IAggregateRootEventHandlers
- Namespace
- Cratis.Chronicle.Aggregates
- Assembly
- Cratis.Chronicle.dll
Defines a system that can handle events for an IAggregateRoot.
public interface IAggregateRootEventHandlers
Properties
EventTypes
Gets a collection of event types that can be handled.
IImmutableList<EventType> EventTypes { get; }
Property Value
HasHandleMethods
Gets whether or not it has any handle methods.
bool HasHandleMethods { get; }
Property Value
Methods
Handle(IAggregateRoot, IEnumerable<EventAndContext>, Action<EventAndContext>?)
Handle a collection of events.
Task Handle(IAggregateRoot target, IEnumerable<EventAndContext> events, Action<EventAndContext>? onHandledEvent = null)
Parameters
target
IAggregateRootThe target IAggregateRoot to handle for.
events
IEnumerable<EventAndContext>Collection of AppendedEvent to handle.
onHandledEvent
Action<EventAndContext>The optional callback to do on each handled event.
Returns
- Task
Awaitable task.