public SqlConnector ForDatabase(Maps.DatabaseName database) { if (database == null) { return(this); } return(new SqlConnector(Replace(connectionString, database), this.Schema, this.DynamicQueryManager, this.Version)); }
public override ObjectName GenerateTableName(Type type, TableNameAttribute tn) { if (tn != null) { if (tn.SchemaName == "sys") { DatabaseName db = Administrator.sysViewDatabase.Value; return(new ObjectName(new SchemaName(db, tn.SchemaName ?? "dbo"), tn.Name)); } } return(base.GenerateTableName(type, tn)); }
public void ToDatabase(DatabaseName databaseName) { this.Name = this.Name.OnDatabase(databaseName); }
public ObjectName OnDatabase(DatabaseName databaseName) { return(new ObjectName(new SchemaName(databaseName, Schema.Name), Name)); }