public IsInheritedFrom ( Table table ) : bool | ||
table | Table | |
return | bool |
public bool IsInheritedFrom(Table table)
{
var t = this.ParentTable;
while (t != null)
{
if (t == table) return true;
t = t.ParentTable;
}
return false;
}
public IEnumerable <Relation> GetRelationsWhereChild(Table table, bool fullHierarchy) { var retval = new List <Relation>(); foreach (Relation relation in this.Relations) { var childTable = relation.ChildTableRef.Object as Table; if (childTable == table) { retval.Add(relation); } else if (fullHierarchy && table.IsInheritedFrom(childTable)) { retval.Add(relation); } } return(retval); }