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

FindParentRelation() private method

Finds a relation that this column is the sole child of or null.
private FindParentRelation ( ) : DataRelation
return DataRelation
        internal DataRelation FindParentRelation()
        {
            var parentRelations = new DataRelation[Table.ParentRelations.Count];
            Table.ParentRelations.CopyTo(parentRelations, 0);

            for (int i = 0; i < parentRelations.Length; i++)
            {
                DataRelation relation = parentRelations[i];
                DataKey key = relation.ChildKey;
                if (key.ColumnsReference.Length == 1 && key.ColumnsReference[0] == this)
                {
                    return relation;
                }
            }

            return null;
        }