Table of Contents

Interface IAggregateRootFactory

Namespace
Cratis.Chronicle.Aggregates
Assembly
Cratis.Chronicle.dll

Defines a factory that can create instances of IAggregateRoot.

public interface IAggregateRootFactory

Methods

Get<TAggregateRoot>(EventSourceId, EventStreamId?, EventSourceType?)

Get an instance of an IAggregateRoot for a specific EventSourceId.

Task<TAggregateRoot> Get<TAggregateRoot>(EventSourceId id, EventStreamId? streamId = null, EventSourceType? eventSourceType = null) where TAggregateRoot : IAggregateRoot

Parameters

id EventSourceId

EventSourceId to get.

streamId EventStreamId

Optional EventStreamId to get. Will default to Default.

eventSourceType EventSourceType

Optional EventSourceType for the context. Will default to Default.

Returns

Task<TAggregateRoot>

The aggregate root instance.

Type Parameters

TAggregateRoot

Type of IAggregateRoot to get.

Remarks

If the aggregate has event handler methods, the events for the specified EventSourceId will be retrieved and the event handler methods will be invoked.