Table of Contents

Interface ITrackedAggregateSource

Namespace
Trellis
Assembly
Trellis.Core.dll

Exposes the set of aggregates a unit of work tracked at the most recent successful commit.

public interface ITrackedAggregateSource
Extension Methods

Remarks

Implemented alongside a unit-of-work abstraction (e.g. Trellis.EntityFrameworkCore.EfUnitOfWork<TContext>) so a pipeline behavior can auto-dispatch domain events for aggregates the unit of work persisted, without reflecting on the command's response shape.

Contract.

  • Returns an empty list before any commit has run on this instance.
  • Returns the aggregates tracked at commit time when the most recent commit succeeded.
  • Returns an empty list when the most recent commit failed or threw.
  • Nested-scope commits that defer (do not touch the database) MUST NOT mutate the snapshot.

The snapshot is captured by reference: callers that iterate CommittedAggregates observe the live aggregate instances, so events raised on them after commit are visible. This is the deliberate enabler for the auto-dispatch pipeline behavior.

Properties

CommittedAggregates

Gets the aggregates the unit of work tracked at its most recent successful commit. Empty before any commit has run, after a failed commit, or after a deferred nested commit.

IReadOnlyList<IAggregate> CommittedAggregates { get; }

Property Value

IReadOnlyList<IAggregate>