System.Data.ConstraintCollection.BaseAdd C# (CSharp) Method

BaseAdd() private method

Does verification on the constraint and it's name. An ArgumentNullException is thrown if this constraint is null. An ArgumentException is thrown if this constraint already belongs to this collection, belongs to another collection. A DuplicateNameException is thrown if this collection already has a constraint with the same name (case insensitive).
private BaseAdd ( Constraint constraint ) : void
constraint Constraint
return void
        private void BaseAdd(Constraint constraint)
        {
            if (constraint == null)
                throw ExceptionBuilder.ArgumentNull(nameof(constraint));

            if (constraint.ConstraintName.Length == 0)
                constraint.ConstraintName = AssignName();
            else
                RegisterName(constraint.ConstraintName);

            constraint.InCollection = true;
        }