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.

◆ Get< TAggregateRoot >()

virtual TAggregateRoot Cqrs.Cache.CacheRepository< TAuthenticationToken >.Get< TAggregateRoot > ( Guid  aggregateId,
IList< IEvent< TAuthenticationToken >>  events = null 
)
virtual

Locks the cache, checks if the aggregate is tracked in the Cache, if it is retrieves the aggregate from the Cache and then uses either the provided events or makes a call IEventStore<TAuthenticationToken>.Get(System.Type,System.Guid,bool,int) on the EventStore and rehydrates the cached aggregate with any new events from it's cached version. If the aggregate is not in the Cache IAggregateRepository<TAuthenticationToken>.Get<TAggregateRoot> is called on the Repository.

Template Parameters
TAggregateRootThe Type of the IAggregateRoot<TAuthenticationToken>.
Parameters
aggregateIdThe ID of the IAggregateRoot<TAuthenticationToken> to get.
eventsA collection of IEvent<TAuthenticationToken> to replay on the retrieved IAggregateRoot<TAuthenticationToken>. If null, the IEventStore<TAuthenticationToken> will be used to retrieve a list of IEvent<TAuthenticationToken> for you.

Implements Cqrs.Domain.IAggregateRepository< TAuthenticationToken >.

Type Constraints
TAggregateRoot :IAggregateRoot<TAuthenticationToken>