Interface IAsyncEventSourceRepository
Represents a repository that stores events in an event store (event sourcing), with asynchronous support.
Inherited Members
Namespace: IRM.Domain.Persistance
Assembly: IRM.dll
Syntax
public interface IAsyncEventSourceRepository : IEventSourceRepository, IDisposable
Methods
GetByIdAsync<TAggregate>(Guid, DateTime, CancellationToken)
An asynchronous version of GetById<TAggregate>(Guid, DateTime), which gets an aggregate from the event store.
Declaration
Task<TAggregate> GetByIdAsync<TAggregate>(Guid id, DateTime loadUntilDate, CancellationToken cancellationToken)
where TAggregate : class, IEventSourced
Parameters
System.Guid
id
The unique identifier of the aggregate. |
System.DateTime
loadUntilDate
The date of the aggregate that should be loaded. |
System.Threading.CancellationToken
cancellationToken
The cancellation instruction. |
Returns
System.Threading.Tasks.Task<TAggregate>
A task representing the asynchronous operation. |
Type Parameters
TAggregate
The type of aggregate to create and load from the events. |
GetByIdAsync<TAggregate>(Guid, Int32, CancellationToken)
An asynchronous version of GetById<TAggregate>(Guid, Int32), which gets an aggregate from the event store.
Declaration
Task<TAggregate> GetByIdAsync<TAggregate>(Guid id, int version, CancellationToken cancellationToken = default(CancellationToken))
where TAggregate : class, IEventSourced
Parameters
System.Guid
id
The unique identifier of the aggregate. |
System.Int32
version
The version of the aggregate that should be loaded. Use System.Int32.MaxValue to load the latest version. |
System.Threading.CancellationToken
cancellationToken
The cancellation instruction. |
Returns
System.Threading.Tasks.Task<TAggregate>
A task representing the asynchronous operation. |
Type Parameters
TAggregate
The type of aggregate to create and load from the events. |
SaveAsync(IEventSourced, Guid, CancellationToken, IMetadataProvider[])
An asynchronous version of Save(IEventSourced, Guid, IMetadataProvider[]), which saves all events created by an aggregate in the event store.
Declaration
Task SaveAsync(IEventSourced aggregate, Guid commitId, CancellationToken cancellationToken = default(CancellationToken), params IMetadataProvider[] metadataProviders)
Parameters
IEventSourced
aggregate
The aggregate that implements IEventSourced. |
System.Guid
commitId
A unique identifier for this commit (save). |
System.Threading.CancellationToken
cancellationToken
The cancellation instruction. |
IMetadataProvider[]
metadataProviders
Zero, one or more IMetadataProvider used to get metadata that can be stored together with the events. |
Returns
System.Threading.Tasks.Task
A task representing the asynchronous operation. |
SaveAsync(IEvent, Guid, CancellationToken, IMetadataProvider[])
An asynchronous version of Save(IEvent, Guid, IMetadataProvider[]), which saves a single event in the event store.
Declaration
Task SaveAsync(IEvent event, Guid commitId, CancellationToken cancellationToken = default(CancellationToken), params IMetadataProvider[] metadataProviders)
Parameters
IEvent
event
The IEvent to store in the event store. |
System.Guid
commitId
A unique identifier for this commit (save). |
System.Threading.CancellationToken
cancellationToken
The cancellation instruction. |
IMetadataProvider[]
metadataProviders
Zero, one or more IMetadataProvider used to get metadata that can be stored together with the events. |
Returns
System.Threading.Tasks.Task
A task representing the asynchronous operation. |