Locks the cache, adds the provided aggregate to the cache if not already in it, then calls IAggregateRepository<TAuthenticationToken>.Save<TAggregateRoot> on Repository. In the event of an Exception the aggregate is always ejected out of the Cache.
- Template Parameters
-
TAggregateRoot | The Type of the IAggregateRoot<TAuthenticationToken>. |
- Parameters
-
aggregate | The IAggregateRoot<TAuthenticationToken> to save and persist. |
expectedVersion | The version number the IAggregateRoot<TAuthenticationToken> is expected to be at. |
Implements Cqrs.Domain.IAggregateRepository< TAuthenticationToken >.
- Type Constraints
-
TAggregateRoot | : | IAggregateRoot<TAuthenticationToken> | |