Table of Contents

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

int?

The event count threshold, or null to disable. Default is null.

TimeThreshold

Gets or sets the time elapsed since the last snapshot that triggers a new snapshot.

public TimeSpan? TimeThreshold { get; set; }

Property Value

TimeSpan?

The time threshold, or null to disable. Default is null.

VersionThreshold

Gets or sets the aggregate version that triggers a new snapshot.

public long? VersionThreshold { get; set; }

Property Value

long?

The version threshold, or null to disable. Default is null.