Table of Contents

Namespace Savvyio.Domain.EventSourcing

Assembly: Savvyio.Core.dll

Instead of storing current aggregate state, event sourcing records every state-changing event and reconstructs the aggregate by replaying them. The Savvyio.Domain.EventSourcing namespace provides the base types that make this possible.

Start with TracedAggregateRoot as the base class for aggregates whose history must be persisted. Each state change produces a TracedDomainEvent that carries the aggregate ID, version, member type, and the delta. Use the extension methods on ITracedDomainEvent to read and write aggregate version metadata. Persistence is provided by Savvyio.Extensions.EFCore.Domain.EventSourcing; DI registration is in Savvyio.Extensions.DependencyInjection.Domain.EventSourcing.

Availability: .NET 10 and .NET 9

Extension Members

Type Ext Methods
T ⬇️ SetAggregateVersion<T>, GetAggregateVersion<T>, GetMemberType<T>

Classes

TracedAggregateRoot<TKey>

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.

TracedDomainEvent

Provides a default implementation of something that happened in the domain that you want other parts of the same domain (in-process/inner-application) to be aware of.

TracedDomainEventExtensions

Extension methods for the ITracedDomainEvent interface.

Interfaces

ITracedAggregateRepository<TEntity, TKey>

Defines a generic way of abstracting traced read- and writable repositories (CRud) that is optimized for Domain Driven Design.

ITracedAggregateRoot<TKey>

Defines an Event Sourcing capable contract of an Aggregate as specified in Domain Driven Design. Implements the IAggregateRoot<TEvent>

ITracedDomainEvent

Specifies something that happened in the domain that you want other parts of the same domain (in-process/inner-application) to be aware of.