public void AddDatabase(Data.Database db) { if (!Databases.Contains(db)) { Databases.Add(db); } }
/// <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); }
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(); }