System.Data.DataRelationCollection.DataTableRelationCollection.AddCore C# (CSharp) Method

AddCore() protected method

protected AddCore ( DataRelation relation ) : void
relation DataRelation
return void
            protected override void AddCore(DataRelation relation)
            {
                if (_fParentCollection)
                {
                    if (relation.ChildTable != _table)
                    {
                        throw ExceptionBuilder.ChildTableMismatch();
                    }
                }
                else
                {
                    if (relation.ParentTable != _table)
                    {
                        throw ExceptionBuilder.ParentTableMismatch();
                    }
                }

                GetDataSet().Relations.Add(relation);
                AddCache(relation);
            }