Class BlobStorageEventStoreConnectionStringFactory
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 BlobStorageEventStoreConnectionStringFactory : IBlobStorageStoreConnectionStringFactory, IStorageStoreConnectionStringFactory
Constructors
BlobStorageEventStoreConnectionStringFactory(IConfigurationManager, ILogger)
Instantiates a new instance of BlobStorageEventStoreConnectionStringFactory.
Declaration
public BlobStorageEventStoreConnectionStringFactory(IConfigurationManager configurationManager, ILogger logger)
Parameters
Type | Name | Description |
---|---|---|
IConfigurationManager | configurationManager | |
cdmdotnet.Logging.ILogger | logger |
Fields
BlobStorageBaseContainerNameKey
The name of the app setting in IConfigurationManager that will have the base name of the container used.
Declaration
public static string BlobStorageBaseContainerNameKey
Field Value
Type | Description |
---|---|
System.String |
BlobStorageEventStoreConnectionStringKey
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 BlobStorageEventStoreConnectionStringKey
Field Value
Type | Description |
---|---|
System.String |
BlobStorageReadableEventStoreConnectionStringKey
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 BlobStorageReadableEventStoreConnectionStringKey
Field Value
Type | Description |
---|---|
System.String |
BlobStorageWritableEventStoreConnectionStringKey
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 BlobStorageWritableEventStoreConnectionStringKey
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 BlobStorageBaseContainerNameKey.
Declaration
public virtual string GetBaseContainerName()
Returns
Type | Description |
---|---|
System.String |
Implements
GetReadableConnectionString()
Gets the readable connection string. If using a single storage account, then BlobStorageEventStoreConnectionStringKey will most likely be returned. If a value for BlobStorageReadableEventStoreConnectionStringKey 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 BlobStorageEventStoreConnectionStringKey will most likely be returned. If a value for BlobStorageWritableEventStoreConnectionStringKey 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> |