Class AggregateRootEventHandlers
- Namespace
- Cratis.Chronicle.Aggregates
- Assembly
- Cratis.Chronicle.dll
Represents an implementation of IAggregateRootEventHandlers.
public class AggregateRootEventHandlers : IAggregateRootEventHandlers
- Inheritance
-
AggregateRootEventHandlers
- Implements
- Inherited Members
Constructors
AggregateRootEventHandlers(IEventTypes, Type)
Initializes a new instance of the AggregateRootEventHandlers class.
public AggregateRootEventHandlers(IEventTypes eventTypes, Type aggregateRootType)
Parameters
eventTypes
IEventTypesIEventTypes for mapping types.
aggregateRootType
TypeType of IAggregateRoot.
Properties
EventTypes
Gets a collection of event types that can be handled.
public IImmutableList<EventType> EventTypes { get; }
Property Value
HasHandleMethods
Gets whether or not it has any handle methods.
public bool HasHandleMethods { get; }
Property Value
Methods
Handle(IAggregateRoot, IEnumerable<EventAndContext>, Action<EventAndContext>?)
Handle a collection of events.
public 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.