public static DatabaseHandlerFactory GetInstance() { if (instance == null) { lock (_lock) { if (instance == null) { instance = new NOSQLDatabaseHandlerFactory(); } } } return(instance); }
/// <summary> /// Drops and recreates the associated database /// </summary> public async Task RecreateDatabase() { if (!DatabaseType.HasValue) { throw new ProjectException("No database type has been selected", null, this); } try { var databaseHandler = DatabaseHandlerFactory.CreateDatabaseHandler(DatabaseType.Value); await databaseHandler.Recreate(ConnectionString); } catch (Exception e) { throw new ProjectException("Cannot recreate database: " + e.Message, e, this); } }