/// <summary>
/// Find all relationships that have a specific child table
/// </summary>
/// <param name="table">The table from which all relations begin</param>
/// <param name="includeHierarchy">Determines if the return includes all tables in the inheritence tree</param>
/// <returns></returns>
public ReadOnlyCollection <ViewRelation> FindByChildTable(CustomView table)
{
try
{
var retval = new List <ViewRelation>();
var tableList = new List <Table>();
var columnList = new List <CustomViewColumn>();
tableList = new List <Table>();
columnList.AddRange(table.GetColumns());
foreach (ViewRelation relation in this)
{
var childTable = relation.ChildView;
foreach (ViewColumnRelationship columnRelationship in relation.ColumnRelationships)
{
foreach (var column in columnList)
{
if (!retval.Contains(relation))
{
retval.Add(relation);
}
}
}
}
return(retval.AsReadOnly());
}
catch (Exception ex)
{
throw;
}
}