Namespace Stratara.Abstractions.EventSourcing
Classes
- AggregationServiceTenantExtensions
Tenant-aware helpers on top of IAggregationService.
- ConcurrencyException
Thrown by SaveChangesAsync(CancellationToken) when another writer committed to the same stream first and the optimistic version check fails. Callers should re-aggregate and retry the operation idempotently.
- EventChainAnchor
Periodic global checkpoint linking the per-stream hash chain into a tamper-evident sequence across every stream of a tenant. Persisted in the
event_chain_anchortable; written by the event-stream-hash worker once enough new events have accrued.
- EventStreamEntry
Event stream entry persisted in the write store. One row per appended event.
- EventUpcasterPipeline
Default IEventUpcasterPipeline. Indexes the registered IEventUpcaster instances by their version-independent SourceEventTypeName and applies them in a chain on read. With no upcasters registered it is a transparent pass-through and never parses the payload.
- PrecedingFactMissingException
Reports that the entity a fact refers to does not exist in the handler's read model yet, so the fact cannot be applied until the fact that created the entity has been.
- Snapshot
Aggregate snapshot — periodic state capture that lets the aggregation service skip replaying every event from the start of a stream.
Structs
- EventSubject
Explicit Subject (data owner) for an event-source append. Used by AppendOnBehalfOfAsync<TAggregate>(Guid, object, EventSubject, CancellationToken) when the Subject is intentionally different from the calling SessionContext's Subject (PlatformAdmin cross-tenant flows, EventStoreMigration regeneration).
- UpcastedEvent
The result of running the IEventUpcasterPipeline: the effective event type name and JSON payload after all matching upcasters have been applied.
Interfaces
- IAggregateCreationEvent
Marker on the first event of an aggregate's lifecycle. The EventSource uses this to resolve the Subject (data-owner tenant id) when a stream is being created and no existing aggregate / per-batch cache entry is available yet.
- IAggregationService
Reconstructs an aggregate by reading its event stream + applying events. Command handlers and sagas use this — never read aggregates from projection views.
- IChangeSetHandler
Diffs an in-flight update-command against the current aggregate state to produce a minimal change-set, then applies the change-set by emitting one field-change event per modified property. Used by the framework's generic update pipeline.
- ICommandAuditRepository
Persists every dispatched command for audit purposes. The
CommandAuditBehaviorpipeline-behavior invokes this; the returned id is propagated to subsequent event appends as theCausationId.
- IEvent
Materialised event with its envelope metadata. Returned by IEventMapperFactory when deserialising rows from the event stream.
- IEventChainRepository
Repository over the event-chain anchor table — periodic global hashes that link the per-stream hash chain into a tamper-evident sequence.
- IEventChainService
Decides whether the global event-chain anchor needs to be advanced and adds a new anchor row when required. Typically invoked from the event-stream-hash worker on each batch.
- IEventMapperFactory
Deserialises persisted EventStreamEntry rows or in-flight EventMessage envelopes into materialised IEvent instances.
- IEventSource
Write-side façade for the event store. Command handlers append events through this service; the implementation tracks pending writes and flushes them on SaveChangesAsync(CancellationToken).
- IEventStreamHashService
Computes per-entry hashes that link events in a stream into a tamper-evident chain. Driven by the
EventStreamHashingworker; runs in batches over the not-yet-hashed tail of the event store.
- IEventStreamRepository
Low-level repository over the
event_stream_entrytable. Implementations live in the EF Core write-store package; consumers typically go through IEventSource instead of using this directly.
- IEventTypeResolver
Resolves an event envelope to a strongly-typed IEvent<TEvent> by loading the runtime Type via the persisted, version-independent type name. Used by projection handlers + sagas + the event-mapper.
- IEventUpcaster
Transforms a persisted event's raw JSON payload from an older on-disk schema into the shape the current event record expects, applied on read before the payload is deserialized into a runtime type. This is the framework's event upcasting hook: it lets an event's structure evolve (renamed / added / defaulted / moved fields, or a renamed event type) without rewriting the immutable events already in the store.
- IEventUpcasterPipeline
Applies the registered IEventUpcaster chain to a persisted event payload on read, before the payload is resolved to a runtime type and deserialized. Consumed by the event-mapping layer; a host with no upcasters registered gets a transparent pass-through.
- IEvent<TEvent>
Strongly-typed view of IEvent with a payload of
TEvent.
- ISnapshotRepository
Repository over the
snapshottable — periodic state captures that let the aggregation service skip replaying every event from the start of a stream.
- ISnapshotService
Decides whether a stream's accumulated event count warrants writing a new snapshot and writes it when needed. Invoked by IEventSource on save.
- ISnapshotStrategy
Decides whether the event-sourcing runtime should write a new snapshot for a stream that has just had events appended. This is the configurable replacement for the framework's formerly hard-coded "snapshot every 50 events, always on" policy.