CQRS.NET  4.0
A lightweight enterprise Function as a Service (FaaS) framework to write function based serverless and micro-service applications in hybrid multi-datacentre, on-premise and Azure environments.
Cqrs.Akka.Snapshots.AkkaSnapshotRepository< TAuthenticationToken > Class Template Reference

Provides basic repository methods for operations with instances of IAggregateRoot<TAuthenticationToken> utilising snapshots for optimised rehydration. More...

+ Inheritance diagram for Cqrs.Akka.Snapshots.AkkaSnapshotRepository< TAuthenticationToken >:

Public Member Functions

 AkkaSnapshotRepository (ISnapshotStore snapshotStore, ISnapshotStrategy< TAuthenticationToken > snapshotStrategy, IAggregateRepository< TAuthenticationToken > repository, IEventStore< TAuthenticationToken > eventStore, IAggregateFactory aggregateFactory)
 Instantiates a new instance of SnapshotRepository<TAuthenticationToken>. More...
 
void Save< TAggregateRoot > (TAggregateRoot aggregate, int? expectedVersion=null)
 Calls TryMakeSnapshot then IAggregateRepository<TAuthenticationToken>.Save<TAggregateRoot> on Repository. More...
 
TAggregateRoot Get< TAggregateRoot > (Guid aggregateId, IList< IEvent< TAuthenticationToken >> events=null)
 Retrieves an IAggregateRoot<TAuthenticationToken> of type TAggregateRoot , First using TryRestoreAggregateFromSnapshot<TAggregateRoot>, otherwise via IAggregateRepository<TAuthenticationToken>.Get<TAggregateRoot> on Repository Then does rehydration. More...
 
TAggregateRoot GetToVersion< TAggregateRoot > (Guid aggregateId, int version, IList< IEvent< TAuthenticationToken >> events=null)
 Retrieves an IAggregateRoot<TAuthenticationToken> of type TAggregateRoot up to and including the provided version . More...
 
TAggregateRoot GetToDate< TAggregateRoot > (Guid aggregateId, DateTime versionedDate, IList< IEvent< TAuthenticationToken >> events=null)
 Retrieves an IAggregateRoot<TAuthenticationToken> of type TAggregateRoot up to and including the provided versionedDate . More...
 
void LoadAggregateHistory< TAggregateRoot > (TAggregateRoot aggregate, IList< IEvent< TAuthenticationToken >> events=null, bool throwExceptionOnNoEvents=true)
 If events is null, loads the events from IEventStore<TAuthenticationToken>, checks for duplicates and then rehydrates the aggregate with the events. More...
 

Protected Member Functions

virtual int TryRestoreAggregateFromSnapshot< TAggregateRoot > (Guid id, TAggregateRoot aggregate)
 Calls ISnapshotStrategy<TAuthenticationToken>.IsSnapshotable on SnapshotStrategy If the TAggregateRoot is snapshot-able ISnapshotStore.Get<TAggregateRoot> is called on SnapshotStore. The Restore method is then called on More...
 
virtual void TryMakeSnapshot (IAggregateRoot< TAuthenticationToken > aggregate, IEnumerable< IEvent< TAuthenticationToken >> uncommittedChanges)
 Calls ISnapshotStrategy<TAuthenticationToken>.ShouldMakeSnapShot on SnapshotStrategy If the IAggregateRoot<TAuthenticationToken> is snapshot-able SnapshotAggregateRoot<TAuthenticationToken,TSnapshot>.GetSnapshot is called The Snapshot.Version is calculated, finally ISnapshotStore.Save is called on SnapshotStore. More...
 

Properties

ISnapshotStore SnapshotStore [get]
 Gets or sets the ISnapshotStore. More...
 
ISnapshotStrategy< TAuthenticationToken > SnapshotStrategy [get]
 Gets or sets the ISnapshotStrategy<TAuthenticationToken>. More...
 
IAggregateRepository< TAuthenticationToken > Repository [get]
 Gets or sets the IAggregateRepository<TAuthenticationToken>. More...
 
IEventStore< TAuthenticationToken > EventStore [get]
 Gets or sets the IEventStore<TAuthenticationToken>. More...
 
IAggregateFactory AggregateFactory [get]
 Gets or sets the IAggregateFactory. More...
 

Detailed Description

Provides basic repository methods for operations with instances of IAggregateRoot<TAuthenticationToken> utilising snapshots for optimised rehydration.

Template Parameters
TAuthenticationTokenThe Type of authentication token.