Class EventSourcedRepositoryOptions
- Namespace
- Excalibur.EventSourcing.Implementation
- Assembly
- Excalibur.EventSourcing.dll
Configuration options for EventSourcedRepository<TAggregate, TKey>.
public sealed class EventSourcedRepositoryOptions
- Inheritance
-
EventSourcedRepositoryOptions
- Inherited Members
Remarks
Consolidates configuration values that were previously individual constructor parameters. Service dependencies (IEventStore, IEventSerializer, etc.) remain as constructor parameters.
Properties
EnableAutoSnapshotUpgrade
Gets or sets a value indicating whether automatic snapshot upgrading is applied on load.
public bool EnableAutoSnapshotUpgrade { get; set; }
Property Value
EnableAutoUpcast
Gets or sets a value indicating whether automatic upcasting is applied during event replay.
public bool EnableAutoUpcast { get; set; }
Property Value
OutboxStagingStrategy
Gets or sets the outbox staging strategy for integration events during aggregate save.
public OutboxStagingStrategy OutboxStagingStrategy { get; set; }
Property Value
- OutboxStagingStrategy
The staging strategy. Default is Auto, which selects the best available strategy based on registered infrastructure.
TargetSnapshotVersion
Gets or sets the target snapshot version for automatic upgrading.
public int TargetSnapshotVersion { get; set; }
Property Value
- int
The target snapshot version. Default is 1.
VerifyStreamReachesSnapshot
Gets or sets whether a load verifies that the event stream still reaches the version of the snapshot it is rehydrating from.
public bool VerifyStreamReachesSnapshot { get; set; }
Property Value
Remarks
Off by default, because the framework cannot produce the damage this detects: it never removes events below a snapshot. A stream that stops short of its snapshot comes from outside -- a manual deletion, a partial restore, or an external retention job trimming the event table. Turn this on if anything other than this framework deletes from your event store.
What it catches: a snapshot at version 50 over a stream whose events stop at version 40 loads zero events after the snapshot -- indistinguishable from the ordinary case of a snapshot at the head of the stream -- and would otherwise rehydrate into an aggregate at a version its own stream never reached. With this on, that load throws instead.
What it costs: one indexed maximum-version query per load whose snapshot is already current, which is the ordinary state of a snapshotted aggregate. Loads that return events cost nothing extra, and a store that does not provide the version-probe capability is never queried and never verified.