public void ChangeDataSource(Stump.ORM.Database datasource) { if (this.m_database == null) { this.m_database = datasource; } else { this.m_database = datasource; this.TearDown(); this.Initialize(); } }
public bool TryConnection(DatabaseConfiguration config) { var db = new Stump.ORM.Database(config.GetConnectionString(), config.ProviderName) { KeepConnectionAlive = true, CommandTimeout = (24 * 60 * 60) }; try { db.OpenSharedConnection(); } catch (Exception) { return(false); } db.CloseSharedConnection(); return(true); }