Class TracedAggregateRoot<TKey>
- Namespace
- Savvyio.Domain.EventSourcing
- Assembly
- Savvyio.Domain.EventSourcing.dll
Provides a way to cover the pattern of an Aggregate as specified in Domain Driven Design that is optimized for Event Sourcing. This is an abstract class.
public abstract class TracedAggregateRoot<TKey> : Aggregate<TKey, ITracedDomainEvent>, ITracedAggregateRoot<TKey>, IAggregateRoot<ITracedDomainEvent>, IAggregateRoot, IMetadata, IEntity<TKey>, IIdentity<TKey>
Type Parameters
TKeyThe type of the key that uniquely identifies this aggregate.
- Inheritance
-
objectEntity<TKey>Aggregate<TKey, ITracedDomainEvent>TracedAggregateRoot<TKey>
- Implements
-
ITracedAggregateRoot<TKey>IEntity<TKey>IIdentity<TKey>
- Inherited Members
- Extension Methods
Constructors
TracedAggregateRoot(IMetadata)
Initializes a new instance of the TracedAggregateRoot<TKey> class.
protected TracedAggregateRoot(IMetadata metadata = null)
Parameters
metadataIMetadataThe optional metadata to merge with this instance.
TracedAggregateRoot(TKey, IEnumerable<ITracedDomainEvent>)
Initializes a new instance of the TracedAggregateRoot<TKey> class.
protected TracedAggregateRoot(TKey id, IEnumerable<ITracedDomainEvent> events)
Parameters
idTKeyThe identifier of the entity.
eventsIEnumerable<ITracedDomainEvent>The events to rehydrate from.
Properties
Version
Gets the version of the Aggregate.
public long Version { get; }
Property Value
- long
The version of the Aggregate.
Methods
AddEvent(ITracedDomainEvent)
Adds an event to the Aggregate.
protected override sealed void AddEvent(ITracedDomainEvent e)
Parameters
eITracedDomainEventThe event to be added to the end of Events.
RegisterDelegates(IFireForgetRegistry<ITracedDomainEvent>)
Registers the delegates responsible for handling types that implements the ITracedDomainEvent interface.
protected abstract void RegisterDelegates(IFireForgetRegistry<ITracedDomainEvent> handler)
Parameters
handlerIFireForgetRegistry<ITracedDomainEvent>The registry that store the delegates of type ITracedDomainEvent.