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.

◆ TryRestoreAggregateFromSnapshot< TAggregateRoot >()

virtual int Cqrs.Snapshots.SnapshotRepository< TAuthenticationToken >.TryRestoreAggregateFromSnapshot< TAggregateRoot > ( Guid  id,
TAggregateRoot  aggregate 
)
protectedvirtual

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

Template Parameters
TAggregateRootThe Type of the IAggregateRoot<TAuthenticationToken>.
Parameters
idThe identifier of the IAggregateRoot<TAuthenticationToken> to restore, since the aggregate may be completely uninitialised.
aggregateThe TAggregateRoot
Returns
-1 if no restoration was made, otherwise version number the TAggregateRoot was rehydrated to.

There may be more events after the snapshot that still need to rehydrated into the TAggregateRoot after restoration.