System.Data.ForeignKeyConstraint.CheckCanAddToCollection C# (CSharp) Method

CheckCanAddToCollection() private method

private CheckCanAddToCollection ( ConstraintCollection constraints ) : void
constraints ConstraintCollection
return void
        internal override void CheckCanAddToCollection(ConstraintCollection constraints)
        {
            if (Table != constraints.Table)
            {
                throw ExceptionBuilder.ConstraintAddFailed(constraints.Table);
            }
            if (Table.Locale.LCID != RelatedTable.Locale.LCID || Table.CaseSensitive != RelatedTable.CaseSensitive)
            {
                throw ExceptionBuilder.CaseLocaleMismatch();
            }
        }

Usage Example

Exemplo n.º 1
0
 private void AddForeignKeyConstraint(ForeignKeyConstraint constraint)
 {
     if (!constraint.CanEnableConstraint())
     {
         throw ExceptionBuilder.ConstraintParentValues();
     }
     constraint.CheckCanAddToCollection(this);
 }
All Usage Examples Of System.Data.ForeignKeyConstraint::CheckCanAddToCollection