If events is null, loads the events from EventStore, checks for duplicates and then rehydrates the aggregate with the events.
- Template Parameters
-
TAggregateRoot | The Type of IAggregateRoot<TAuthenticationToken>. |
- Parameters
-
aggregate | The TAggregateRoot to rehydrate. |
version | Load events up-to and including from this version |
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. |
throwExceptionOnNoEvents | If true will throw an instance of AggregateNotFoundException<TAggregateRoot,TAuthenticationToken> if no aggregate events or provided or found in the EventStore. |
- Type Constraints
-
TAggregateRoot | : | IAggregateRoot<TAuthenticationToken> | |