System.Data.DataColumn.IsInRelation C# (CSharp) Method

IsInRelation() private method

Returns true if this column is a part of a Parent or Child key for a relation.
private IsInRelation ( ) : bool
return bool
        internal bool IsInRelation()
        {
            DataKey key;
            DataRelationCollection rels = _table.ParentRelations;

            Debug.Assert(rels != null, "Invalid ParentRelations");
            for (int i = 0; i < rels.Count; i++)
            {
                key = rels[i].ChildKey;
                Debug.Assert(key.HasValue, "Invalid child key (null)");
                if (key.ContainsColumn(this))
                {
                    return true;
                }
            }

            rels = _table.ChildRelations;
            Debug.Assert(rels != null, "Invalid ChildRelations");
            for (int i = 0; i < rels.Count; i++)
            {
                key = rels[i].ParentKey;
                Debug.Assert(key.HasValue, "Invalid parent key (null)");
                if (key.ContainsColumn(this))
                {
                    return true;
                }
            }

            return false;
        }