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
EventSourceIdEventSourceId to get.
streamId
EventStreamIdOptional EventStreamId to get. Will default to Default.
eventSourceType
EventSourceTypeOptional 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.