Class TableStorageEventStore<TAuthenticationToken>
An Azure Storage based EventStore<TAuthenticationToken>.
Inheritance
Inherited Members
Namespace: Cqrs.Azure.BlobStorage.Events
Assembly: Cqrs.Azure.BlobStorage.dll
Syntax
public class TableStorageEventStore<TAuthenticationToken> : EventStore<TAuthenticationToken>, IEventStore<TAuthenticationToken>
Type Parameters
Name | Description |
---|---|
TAuthenticationToken | The System.Type of the authentication token. |
Constructors
TableStorageEventStore(IEventBuilder<TAuthenticationToken>, IEventDeserialiser<TAuthenticationToken>, ILogger, ITableStorageStoreConnectionStringFactory, Func<ILogger, ITableStorageStoreConnectionStringFactory, Boolean, TableStorageEventStore<TAuthenticationToken>.RawTableStorageEventStore>)
Initializes a new instance of the TableStorageEventStore<TAuthenticationToken> class using the specified container.
Declaration
public TableStorageEventStore(IEventBuilder<TAuthenticationToken> eventBuilder, IEventDeserialiser<TAuthenticationToken> eventDeserialiser, ILogger logger, ITableStorageStoreConnectionStringFactory tableStorageEventStoreConnectionStringFactory, Func<ILogger, ITableStorageStoreConnectionStringFactory, bool, TableStorageEventStore<TAuthenticationToken>.RawTableStorageEventStore> createRawTableStorageEventStoreFunction = null)
Parameters
Type | Name | Description |
---|---|---|
IEventBuilder<TAuthenticationToken> | eventBuilder | |
IEventDeserialiser<TAuthenticationToken> | eventDeserialiser | |
cdmdotnet.Logging.ILogger | logger | |
ITableStorageStoreConnectionStringFactory | tableStorageEventStoreConnectionStringFactory | |
System.Func<cdmdotnet.Logging.ILogger, ITableStorageStoreConnectionStringFactory, System.Boolean, TableStorageEventStore.RawTableStorageEventStore<>> | createRawTableStorageEventStoreFunction |
Fields
TableCqrsEventStoreStreamNamePattern
The pattern used to generate the stream name.
Declaration
protected const string TableCqrsEventStoreStreamNamePattern = "{0}.{1}"
Field Value
Type | Description |
---|---|
System.String |
Properties
CorrelationIdTableStorageStore
Gets or sets the underlying TableStorageStore used specifically for Get(Guid).
Declaration
protected TableStorageEventStore<TAuthenticationToken>.RawTableStorageEventStore CorrelationIdTableStorageStore { get; set; }
Property Value
Type | Description |
---|---|
TableStorageEventStore.RawTableStorageEventStore<> |
TableStorageStore
Gets or sets the underlying TableStorageStore used for persisting and reading IEvent<TAuthenticationToken> data.
Declaration
protected TableStorageEventStore<TAuthenticationToken>.RawTableStorageEventStore TableStorageStore { get; set; }
Property Value
Type | Description |
---|---|
TableStorageEventStore.RawTableStorageEventStore<> |
Methods
GenerateStreamName(Type, Guid)
Generate a unique stream name based on the provided aggregateRootType
and the aggregateId
.
Declaration
protected override string GenerateStreamName(Type aggregateRootType, Guid aggregateId)
Parameters
Type | Name | Description |
---|---|---|
System.Type | aggregateRootType | The System.Type of the IAggregateRoot<TAuthenticationToken>. |
System.Guid | aggregateId | The ID of the IAggregateRoot<TAuthenticationToken>. |
Returns
Type | Description |
---|---|
System.String |
Overrides
Get(Guid)
Get all IEvent<TAuthenticationToken> instances for the given correlationId
.
Declaration
public override IEnumerable<EventData> Get(Guid correlationId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | correlationId | The CorrelationId of the IEvent<TAuthenticationToken> instances to retrieve. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<EventData> |
Overrides
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 = -1)
Parameters
Type | Name | Description |
---|---|---|
System.Type | aggregateRootType | System.Type of the IAggregateRoot<TAuthenticationToken> the IEvent<TAuthenticationToken> was raised in. |
System.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 |
---|---|
System.Collections.Generic.IEnumerable<IEvent<TAuthenticationToken>> |
Overrides
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. |