Class DefaultSnapshotStrategy<TAuthenticationToken>
An ISnapshotStrategy<TAuthenticationToken> that takes a snapshot every 15 versions.
Inheritance
System.Object
DefaultSnapshotStrategy<TAuthenticationToken>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Cqrs.Snapshots
Assembly: Cqrs.dll
Syntax
public class DefaultSnapshotStrategy<TAuthenticationToken> : ISnapshotStrategy<TAuthenticationToken>
Type Parameters
Name | Description |
---|---|
TAuthenticationToken | The System.Type of the authentication token. |
Methods
GetSnapshotInterval()
Returns the value of Cqrs.Snapshots.DefaultSnapshotStrategy`1.SnapshotInterval.
Declaration
protected virtual int GetSnapshotInterval()
Returns
Type | Description |
---|---|
System.Int32 |
IsSnapshotable(Type)
Indicates if the aggregateType
is able to be snapshotted by checking if the aggregateType
directly inherits SnapshotAggregateRoot<TAuthenticationToken, TSnapshot>
Declaration
public virtual bool IsSnapshotable(Type aggregateType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | aggregateType | The System.Type of IAggregateRoot<TAuthenticationToken> to check. |
Returns
Type | Description |
---|---|
System.Boolean |
Implements
ShouldMakeSnapShot(IAggregateRoot<TAuthenticationToken>)
Checks IsSnapshotable(Type) and if it is, also checks if the calculated version number would be exactly dividable by GetSnapshotInterval().
Declaration
public virtual bool ShouldMakeSnapShot(IAggregateRoot<TAuthenticationToken> aggregate)
Parameters
Type | Name | Description |
---|---|---|
IAggregateRoot<TAuthenticationToken> | aggregate | The IAggregateRoot<TAuthenticationToken> to check. |
Returns
Type | Description |
---|---|
System.Boolean |