Beispiel #1
0
 public static void AddPool(MongodbDatabase db)
 {
     if (db.IsNull())
     {
         return;
     }
     AddPool(db.Pool, db);
 }
Beispiel #2
0
 public static void AddPool(string key, MongodbDatabase db = null) {
     if (key.IsNullEmpty()) return;
     key = key.ToLower();
     if (pool.ContainsKey(key)) return;
     if (db.IsNull()) {
         MongodbDatabase newdb = new MongodbDatabase(key);
         newdb.Pool = key;
         pool[key] = newdb;
         poolkey.Add(key);
     } else {
         pool[key] = db;
         poolkey.Add(key);
     }
 }
Beispiel #3
0
 public static void AddPool(string key, MongodbDatabase db = null)
 {
     if (key.IsNullEmpty())
     {
         return;
     }
     key = key.ToLower();
     if (pool.ContainsKey(key))
     {
         return;
     }
     if (db.IsNull())
     {
         MongodbDatabase newdb = new MongodbDatabase(key);
         newdb.Pool = key;
         pool[key]  = newdb;
         poolkey.Add(key);
     }
     else
     {
         pool[key] = db;
         poolkey.Add(key);
     }
 }
Beispiel #4
0
 public static void AddPool(MongodbDatabase db) {
     if (db.IsNull()) return;
     AddPool(db.Pool, db);
 }