public static bool SchemaEquals(SchemaID sid, SchemaID sid2) { if (sid == null || sid2 == null || SchemaID.GetSchemaHashCode(sid) != SchemaID.GetSchemaHashCode(sid2)) { return(false); } return(sid2.SchemaName.Equals(sid.SchemaName) && sid2.DatabaseEquals(sid)); }
public static int GetSchemaHashCode(SchemaID sid) { if (!sid._hashCode.HasValue) { sid._hashCode = sid._schemaName.GetHashCode(); } return(DatabaseID.GetDatabaseHashCode(sid) * 17 + sid._hashCode.Value); }
private static void BrowseTables(Table table, DatabaseDictionary <TableID, Table> seenTables, DatabaseDictionary <TableID, Table> notSeen, List <Table> cluster) { cluster.Add(table); notSeen.Remove(table); seenTables.Add(table, table); foreach (var reference in table.References.Concat(table.ReferencedBy)) { if (seenTables.ContainsKey(reference) || !SchemaID.SchemaEquals(reference.Schema, table.Schema)) { continue; } else { BrowseTables(reference, seenTables, notSeen, cluster); } } }
public SchemaContext(SchemaID schema, IEnumerable <TableID> tables) : this(schema) { this.Tables = tables.Select(t => new TableID(t)); }
public SchemaContext(SchemaID schema) { this.Location = ContextLocation.Schema; this.Schema = schema; }
public SchemaID(SchemaID schemaID) : base(schemaID.DatabaseName) { this.SchemaName = schemaID.SchemaName; }