Class MongoDbDataStoreConnectionStringFactory
A factory for getting connection strings and database names for IDataStore<TData> access.
Inheritance
System.Object
MongoDbDataStoreConnectionStringFactory
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Cqrs.MongoDB.Factories
Assembly: Cqrs.MongoDB.dll
Syntax
public class MongoDbDataStoreConnectionStringFactory : IMongoDbDataStoreConnectionStringFactory
Constructors
MongoDbDataStoreConnectionStringFactory(IConfigurationManager, ILogger)
Instantiates a new instance of MongoDbDataStoreConnectionStringFactory.
Declaration
public MongoDbDataStoreConnectionStringFactory(IConfigurationManager configurationManager, ILogger logger)
Parameters
Type | Name | Description |
---|---|---|
IConfigurationManager | configurationManager | |
cdmdotnet.Logging.ILogger | logger |
Fields
MongoDbConnectionStringKey
The name of the app setting in IConfigurationManager that will have the name of the connection string of the MongoDB server.
Declaration
public static string MongoDbConnectionStringKey
Field Value
Type | Description |
---|---|
System.String |
MongoDbDatabaseNameKey
The name of the app setting in IConfigurationManager that will have the name of the database.
Declaration
public static string MongoDbDatabaseNameKey
Field Value
Type | Description |
---|---|
System.String |
OldMongoDbConnectionStringKey
Backwards compatibility with version 1.
Declaration
public static string OldMongoDbConnectionStringKey
Field Value
Type | Description |
---|---|
System.String |
OldMongoDbDatabaseNameKey
Backwards compatibility with version 1.
Declaration
public static string OldMongoDbDatabaseNameKey
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
GetDataStoreConnectionString()
Gets the current connection string.
Declaration
public string GetDataStoreConnectionString()
Returns
Type | Description |
---|---|
System.String |
Implements
GetDataStoreDatabaseName()
Gets the current database name.
Declaration
public string GetDataStoreDatabaseName()
Returns
Type | Description |
---|---|
System.String |