Beispiel #1
0
        /// <summary>
        /// Get the default connection
        /// </summary>
        /// <param name="databaseName">Name of the database to get the default connection from</param>
        /// <returns></returns>
        public System.Data.Common.DbConnectionStringBuilder RequestDefaultConnection(string databaseName, string projectName = "")
        {
            DbConnectionStringBuilder dbStringBuilder = new DbConnectionStringBuilder(false);

            dbStringBuilder.ConnectionString = MongoDBDatabase.BuildDefaultConnectionString(databaseName);
            return(dbStringBuilder);
        }
Beispiel #2
0
        /// <summary>
        /// Create an instance of database object
        /// </summary>
        /// <param name="connectionStringBuilder">A connection string builder which contains the connection string</param>
        /// <returns>IDbDriver instance</returns>
        public IDbDriver CreateDatabaseObject(System.Data.Common.DbConnectionStringBuilder connectionStringBuilder)
        {
            IDbDriver instance = new MongoDBDatabase();

            instance.ConnectionString = connectionStringBuilder.ConnectionString;

            return(instance);
        }