Exemplo n.º 1
0
 public void AddDatabase(Data.Database db)
 {
     if (!Databases.Contains(db))
     {
         Databases.Add(db);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Tell the instance on what database should be active.
 /// </summary>
 /// <param name="databaseName"></param>
 /// <param name="mongoDatabaseSettings"></param>
 /// <returns></returns>
 public IMongoDatabase UseDatabase(string databaseName, MongoDatabaseSettings mongoDatabaseSettings = null)
 {
     if (!Databases.Contains(databaseName))
     {
         throw new Exception($"Database '{databaseName}' is not exists in current connection (found {string.Join(",", Databases)})");
     }
     ActiveDatabase = Connection.GetDatabase(databaseName, mongoDatabaseSettings);
     return(ActiveDatabase);
 }
Exemplo n.º 3
0
 public void LoadDatabase(string[] files)
 {
     if (files != null && files.Length > 0)
     {
         foreach (var item in files)
         {
             SqliteInfo sqliteInfo = ParseInfo(item);
             if (sqliteInfo != null && !Databases.Contains(sqliteInfo))
             {
                 Databases.Add(sqliteInfo);
             }
         }
     }
     JoinInfo();
     Search();
 }