Class TableStorageEventStoreConnectionStringFactory
A factory for getting connection strings and container names for IEventStore<TAuthenticationToken> access. This factory supports reading and writing from separate storage accounts. Specifically you can have as many different storage accounts as you want to configure when writing. This allows for manual mirroring of data while reading from the fastest/closest location possible.
Inheritance
Inherited Members
Namespace: Cqrs.Azure.BlobStorage.Events
Assembly: Cqrs.Azure.BlobStorage.dll
Syntax
public class TableStorageEventStoreConnectionStringFactory : ITableStorageStoreConnectionStringFactory, IStorageStoreConnectionStringFactory
Constructors
TableStorageEventStoreConnectionStringFactory(IConfigurationManager, ILogger)
Instantiates a new instance of TableStorageEventStoreConnectionStringFactory.
Declaration
public TableStorageEventStoreConnectionStringFactory(IConfigurationManager configurationManager, ILogger logger)
Parameters
Type | Name | Description |
---|---|---|
IConfigurationManager | configurationManager | |
cdmdotnet.Logging.ILogger | logger |
Fields
TableStorageBaseContainerNameKey
The name of the app setting in IConfigurationManager that will have the base name of the container used.
Declaration
public static string TableStorageBaseContainerNameKey
Field Value
Type | Description |
---|---|
System.String |
TableStorageEventStoreConnectionStringKey
The name of the app setting in IConfigurationManager that will have the connection string if using a single storage account for both reads and writes.
Declaration
public static string TableStorageEventStoreConnectionStringKey
Field Value
Type | Description |
---|---|
System.String |
TableStorageReadableEventStoreConnectionStringKey
The name of the app setting in IConfigurationManager that will have the connection string of the readable storage account if using a separate storage account for reads and writes.
Declaration
public static string TableStorageReadableEventStoreConnectionStringKey
Field Value
Type | Description |
---|---|
System.String |
TableStorageWritableEventStoreConnectionStringKey
The name of the app setting in IConfigurationManager that will have the connection string of the writeable storage account if using a separate storage account for reads and writes. This value gets appended with a ".1", ".2" etc allowing you to write to as many different locations as possible.
Declaration
public static string TableStorageWritableEventStoreConnectionStringKey
Field Value
Type | Description |
---|---|
System.String |
Properties
ConfigurationManager
Gets or sets the IConfigurationManager.
Declaration
protected IConfigurationManager ConfigurationManager { get; }
Property Value
Type | Description |
---|---|
IConfigurationManager |
Logger
Gets or sets the cdmdotnet.Logging.ILogger.
Declaration
protected ILogger Logger { get; }
Property Value
Type | Description |
---|---|
cdmdotnet.Logging.ILogger |
Methods
GetBaseContainerName()
Returns the name of the base contain to be used. This will be the value from ConfigurationManager keyed TableStorageBaseContainerNameKey.
Declaration
public virtual string GetBaseContainerName()
Returns
Type | Description |
---|---|
System.String |
Implements
GetReadableConnectionString()
Gets the readable connection string. If using a single storage account, then TableStorageEventStoreConnectionStringKey will most likely be returned. If a value for TableStorageReadableEventStoreConnectionStringKey is found, that will be returned instead.
Declaration
public virtual string GetReadableConnectionString()
Returns
Type | Description |
---|---|
System.String |
Implements
GetWritableConnectionStrings()
Gets all writeable connection strings. If using a single storage account, then TableStorageEventStoreConnectionStringKey will most likely be returned. If a value for TableStorageWritableEventStoreConnectionStringKey is found, it will append ".1", ".2" etc returning any additionally found connection string values in ConfigurationManager.
Declaration
public virtual IEnumerable<string> GetWritableConnectionStrings()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> |