Source/MongoDB/a_mongo_db_instance.cs
/// <summary>
/// Creates the MongoDB connection with the specified database name and whether to use a single node replica set.
/// </summary>
/// <param name="dbName">Name of the database.</param>
/// <param name="replSet">Use a single node replicate set. Defaults to false.</param>
Creates the MongoDB connection with the specified database name and whether to use a single node replica set.
Creates the MongoDB connection with the specified database name and whether to use a single node replica set .
protected static void CreateDBConnection(string dbName, bool replSet = false)
        {
            database_name = dbName;
            runner = MongoDbRunner.Start(singleNodeReplSet: replSet);
            connection_string = runner.ConnectionString;
            client = new MongoClient(connection_string);
            database = client.GetDatabase(database_name);
            configuration_for_read_model_repository =
                new Dolittle.ReadModels.MongoDB.Configuration(
                    new FakeIConfigurationFor(connection_string, database_name));
        }
protected static void CreateDBConnection ( string dbName , bool replSet = false ) { database_name = dbName ; runner = MongoDbRunner . Start ( singleNodeReplSet : replSet ) ; connection_string = runner . ConnectionString ; client = new MongoClient ( connection_string ) ; database = client . GetDatabase ( database_name ) ; configuration_for_read_model_repository = new Dolittle . ReadModels . MongoDB . Configuration ( new FakeIConfigurationFor ( connection_string , database_name ) ) ; }
Creates the MongoDB connection with the specified database name and whether to use a single node replica set.
Creates the MongoDB connection with the specified database name and whether to use a single node replica set .
dbName
string
Name of the database.
Name of the database .
replSet
bool
Use a single node replicate set. Defaults to false.
Use a single node replicate set . Defaults to false .