Table of Contents

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

TKey

The type of the key that uniquely identifies this aggregate.

Inheritance
Object
Entity<TKey>
TracedAggregateRoot<TKey>
Implements
IEntity<TKey>
IIdentity<TKey>
Inherited Members

Constructors

TracedAggregateRoot(TKey, IEnumerable<ITracedDomainEvent>)

Initializes a new instance of the TracedAggregateRoot<TKey> class.

protected TracedAggregateRoot(TKey id, IEnumerable<ITracedDomainEvent> events)

Parameters

id TKey

The identifier of the entity.

events IEnumerable<ITracedDomainEvent>

The events to rehydrate from.

TracedAggregateRoot(IMetadata)

Initializes a new instance of the TracedAggregateRoot<TKey> class.

protected TracedAggregateRoot(IMetadata metadata = null)

Parameters

metadata IMetadata

The optional metadata to merge with this instance.

Properties

Version

Gets the version of the Aggregate.

public long Version { get; }

Property Value

Int64

The version of the Aggregate.

Methods

AddEvent(ITracedDomainEvent)

Adds an event to the Aggregate.

protected sealed override void AddEvent(ITracedDomainEvent e)

Parameters

e ITracedDomainEvent

The 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

handler IFireForgetRegistry<ITracedDomainEvent>

The registry that store the delegates of type ITracedDomainEvent.

See Also

Aggregate<TKey, TEvent>
ITracedAggregateRoot<TKey>