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
-
TAggregateRoot | The Type of the IAggregateRoot<TAuthenticationToken>. |
- Parameters
-
aggregateId | The ID of the IAggregateRoot<TAuthenticationToken> to get. |
events | A 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> | |