Class AzureDocumentDbEventStore<TAuthenticationToken>
A DocumentDb based EventStore<TAuthenticationToken>.
Inheritance
Inherited Members
Namespace: Cqrs.Azure.DocumentDb.Events
Assembly: Cqrs.Azure.DocumentDb.dll
Syntax
public class AzureDocumentDbEventStore<TAuthenticationToken> : EventStore<TAuthenticationToken>, IEventStore<TAuthenticationToken>
Type Parameters
Name | Description |
---|---|
TAuthenticationToken | The |
Constructors
AzureDocumentDbEventStore(IEventBuilder<TAuthenticationToken>, IEventDeserialiser<TAuthenticationToken>, ILogger, IAzureDocumentDbHelper, IAzureDocumentDbEventStoreConnectionStringFactory)
Instantiate a new instance of AzureDocumentDbEventStore<TAuthenticationToken>.
Declaration
public AzureDocumentDbEventStore(IEventBuilder<TAuthenticationToken> eventBuilder, IEventDeserialiser<TAuthenticationToken> eventDeserialiser, ILogger logger, IAzureDocumentDbHelper azureDocumentDbHelper, IAzureDocumentDbEventStoreConnectionStringFactory azureDocumentDbEventStoreConnectionStringFactory)
Parameters
Type | Name | Description |
---|---|---|
IEventBuilder<TAuthenticationToken> | eventBuilder | |
IEventDeserialiser<TAuthenticationToken> | eventDeserialiser | |
ILogger | logger | |
IAzureDocumentDbHelper | azureDocumentDbHelper | |
IAzureDocumentDbEventStoreConnectionStringFactory | azureDocumentDbEventStoreConnectionStringFactory |
Fields
UniqueIndexProperties
The properties that must be unique.
Declaration
protected readonly string[] UniqueIndexProperties
Field Value
Type | Description |
---|---|
System.String[] |
Properties
AzureDocumentDbEventStoreConnectionStringFactory
Gets or sets the IAzureDocumentDbEventStoreConnectionStringFactory
Declaration
protected IAzureDocumentDbEventStoreConnectionStringFactory AzureDocumentDbEventStoreConnectionStringFactory { get; }
Property Value
Type | Description |
---|---|
IAzureDocumentDbEventStoreConnectionStringFactory |
AzureDocumentDbHelper
Gets or sets the IAzureDocumentDbHelper
Declaration
protected IAzureDocumentDbHelper AzureDocumentDbHelper { get; }
Property Value
Type | Description |
---|---|
IAzureDocumentDbHelper |
Methods
Get(Guid)
Get all IEvent<TAuthenticationToken> instances for the given correlationId
.
Declaration
public override IEnumerable<EventData> Get(Guid correlationId)
Parameters
Type | Name | Description |
---|---|---|
Guid | correlationId | The CorrelationId of the IEvent<TAuthenticationToken> instances to retrieve. |
Returns
Type | Description |
---|---|
IEnumerable<EventData> |
Get(Type, Guid, Boolean, Int32)
Gets a collection of IEvent<TAuthenticationToken> for the IAggregateRoot<TAuthenticationToken> of type aggregateRootType
with the ID matching the provided aggregateId
.
Declaration
public override IEnumerable<IEvent<TAuthenticationToken>> Get(Type aggregateRootType, Guid aggregateId, bool useLastEventOnly = false, int fromVersion = null)
Parameters
Type | Name | Description |
---|---|---|
Type | aggregateRootType | |
Guid | aggregateId | The Id of the IAggregateRoot<TAuthenticationToken>. |
System.Boolean | useLastEventOnly | Loads only the last eventIEvent<TAuthenticationToken>. |
System.Int32 | fromVersion | Load events starting from this version |
Returns
Type | Description |
---|---|
IEnumerable<IEvent<TAuthenticationToken>> |
GetAsync(Guid)
Get all IEvent<TAuthenticationToken> instances for the given correlationId
.
Declaration
protected Task<IEnumerable<EventData>> GetAsync(Guid correlationId)
Parameters
Type | Name | Description |
---|---|---|
Guid | correlationId | The CorrelationId of the IEvent<TAuthenticationToken> instances to retrieve. |
Returns
Type | Description |
---|---|
Task<IEnumerable<EventData>> |
GetAsync(Type, Guid, Boolean, Int32)
Gets a collection of IEvent<TAuthenticationToken> for the IAggregateRoot<TAuthenticationToken> of type aggregateRootType
with the ID matching the provided aggregateId
.
Declaration
protected Task<IEnumerable<IEvent<TAuthenticationToken>>> GetAsync(Type aggregateRootType, Guid aggregateId, bool useLastEventOnly = false, int fromVersion = null)
Parameters
Type | Name | Description |
---|---|---|
Type | aggregateRootType | |
Guid | aggregateId | The Id of the IAggregateRoot<TAuthenticationToken>. |
System.Boolean | useLastEventOnly | Loads only the last eventIEvent<TAuthenticationToken>. |
System.Int32 | fromVersion | Load events starting from this version |
Returns
Type | Description |
---|---|
Task<IEnumerable<IEvent<TAuthenticationToken>>> |
GetAsync<T>(Guid, Boolean, Int32)
Gets a collection of IEvent<TAuthenticationToken> for the IAggregateRoot<TAuthenticationToken> of type T
with the ID matching the provided aggregateId
.
Declaration
protected Task<IEnumerable<IEvent<TAuthenticationToken>>> GetAsync<T>(Guid aggregateId, bool useLastEventOnly = false, int fromVersion = null)
Parameters
Type | Name | Description |
---|---|---|
Guid | aggregateId | The Id of the IAggregateRoot<TAuthenticationToken>. |
System.Boolean | useLastEventOnly | Loads only the last eventIEvent<TAuthenticationToken>. |
System.Int32 | fromVersion | Load events starting from this version |
Returns
Type | Description |
---|---|
Task<IEnumerable<IEvent<TAuthenticationToken>>> |
Type Parameters
Name | Description |
---|---|
T |
PersistEvent(EventData)
Persist the provided eventData
into storage.
Declaration
protected override void PersistEvent(EventData eventData)
Parameters
Type | Name | Description |
---|---|---|
EventData | eventData | The EventData to persist. |