static DbGateway() { if (ConfigurationManager.ConnectionStrings == null || ConfigurationManager.ConnectionStrings.Count.Equals(0)) { throw new ConfigException("Please provide a connection string including name, provider and connection string."); } string connectionStringSectionName = ConfigurationManager.ConnectionStrings[0].Name; DbProvider dbProvider = DbProviderFactory.CreateDbProvider(connectionStringSectionName); defaultDbGateway = new DbGateway(new Database(dbProvider)); }
public static void SetDefaultDatabase(DatabaseType databaseType, string connectionString) { defaultDbGateway = new DbGateway(new Database(CreateDbProvider(databaseType, connectionString))); }
public static void SetDefaultDatabase(string connectionStringSectionName) { defaultDbGateway = new DbGateway(connectionStringSectionName); }