IAggregateEventStore<TKey> Interface


IAggregateEventStore<TKey> interface provides the following methods:

Task<TAggregate> Get<TAggregate>(Guid streamId, CancellationToken cancellationToken = default) where TAggregate : IAggregateRoot<TKey> Reconstructs the aggregate to its current state.
Task<TAggregate> GetByVersion<TAggregate>(Guid streamId, long version, CancellationToken cancellationToken = default) where TAggregate : IAggregateRoot<TKey> Reconstructs the aggregate’s state based on the specified version.
Task<TAggregate> GetByVersion<TAggregate>(Guid streamId, long version, TAggregate aggregate, CancellationToken cancellationToken = default) where TAggregate : IAggregateRoot<TKey> Reconstructs the aggregate’s state based on the specified version.
Task Store<TAggregate>(TAggregate aggregate, CancellationToken cancellationToken = default) where TAggregate : IAggregateRoot<TKey> Stores the events of an aggregate in the event store.
Task Delete<TAggregate>(TAggregate aggregate, CancellationToken cancellationToken = default) where TAggregate : IAggregateRoot<TKey> Deletes the events for the specified aggregate from the event store. If there are any event handlers associated with the aggregate’s events, then this method will trigger the event handlers.
Task Delete<TAggregate>(Guid streamId, CancellationToken cancellationToken = default) where TAggregate : IAggregateRoot<TKey> Deletes the events for the specified stream from the event store. This method will not trigger the event handlers of an aggregate.