Table of Contents

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 IEventTypes

IEventTypes for mapping types.

aggregateRootType Type

Type of IAggregateRoot.

Properties

EventTypes

Gets a collection of event types that can be handled.

public IImmutableList<EventType> EventTypes { get; }

Property Value

IImmutableList<EventType>

HasHandleMethods

Gets whether or not it has any handle methods.

public bool HasHandleMethods { get; }

Property Value

bool

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 IAggregateRoot

The 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.