Class AutoSnapshotOptions
- Namespace
- Excalibur.EventSourcing
- Assembly
- Excalibur.EventSourcing.Abstractions.dll
Configuration options for automatic snapshot creation after SaveAsync.
public sealed class AutoSnapshotOptions
- Inheritance
-
AutoSnapshotOptions
- Inherited Members
Remarks
When any threshold is met, a snapshot is created inline after events are committed. Snapshot failure is best-effort -- it does not fail the save operation.
All thresholds are disabled by default (null). When multiple thresholds are set, any single match triggers a snapshot.
Per-aggregate-type overrides are supported via named options:
UseAutoSnapshots<TAggregate>(options => { ... }).
Properties
CustomPolicy
Gets or sets a custom policy function for advanced snapshot decision logic.
public Func<SnapshotDecisionContext, bool>? CustomPolicy { get; set; }
Property Value
- Func<SnapshotDecisionContext, bool>
A function returning true to trigger a snapshot, or null to disable. Default is null.
EventCountThreshold
Gets or sets the number of events since the last snapshot that triggers a new snapshot.
public int? EventCountThreshold { get; set; }
Property Value
TimeThreshold
Gets or sets the time elapsed since the last snapshot that triggers a new snapshot.
public TimeSpan? TimeThreshold { get; set; }
Property Value
VersionThreshold
Gets or sets the aggregate version that triggers a new snapshot.
public long? VersionThreshold { get; set; }