Class NoSnapshotStrategy
- Namespace
- Excalibur.EventSourcing.Snapshots
- Assembly
- Excalibur.EventSourcing.dll
Snapshot strategy that never creates snapshots.
public sealed class NoSnapshotStrategy : ISnapshotStrategy
- Inheritance
-
NoSnapshotStrategy
- Implements
- Inherited Members
Remarks
Use this strategy when snapshots are not desired, such as for aggregates with short event histories or when event replay is always acceptable.
Properties
Instance
Gets the singleton instance of the no-op snapshot strategy.
public static NoSnapshotStrategy Instance { get; }
Property Value
Methods
ShouldCreateSnapshot(IAggregateRoot)
Determines whether a snapshot should be created for the aggregate.
[RequiresUnreferencedCode("Snapshot strategy evaluation may require types that cannot be statically analyzed. Consider using source generation.")]
[RequiresDynamicCode("Snapshot strategy evaluation may require dynamic code generation which is not compatible with AOT compilation.")]
public bool ShouldCreateSnapshot(IAggregateRoot aggregate)
Parameters
aggregateIAggregateRootThe aggregate to check.
Returns
- bool
True if a snapshot should be created, otherwise false.