2 types derived from Constraint
System.Data.Common (2)
System\Data\ForeignKeyConstraint.cs (1)
18public class ForeignKeyConstraint : Constraint
System\Data\UniqueConstraint.cs (1)
16public class UniqueConstraint : Constraint
87 references to Constraint
netstandard (1)
netstandard.cs (1)
483[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Constraint))]
System.Data (1)
src\libraries\shims\System.Data\ref\System.Data.cs (1)
57[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Constraint))]
System.Data.Common (85)
System\Data\Constraint.cs (2)
96internal abstract Constraint? Clone(DataSet destination); 97internal abstract Constraint? Clone(DataSet destination, bool ignoreNSforTableLookup);
System\Data\ConstraintCollection.cs (51)
24private Constraint[]? _delayLoadingConstraints; 42/// Gets the <see cref='System.Data.Constraint'/> 45public Constraint this[int index] 51return (Constraint)List[index]!; 63/// Gets the <see cref='System.Data.Constraint'/> from the collection with the specified name. 65public Constraint? this[string? name] 74return (index < 0) ? null : (Constraint)List[index]!; 81public void Add(Constraint constraint) => Add(constraint, true); 84internal void Add(Constraint constraint, bool addUniqueWhenAddingForeign) 92if (FindConstraint(constraint) is Constraint matchedConstraint) 152public Constraint Add(string? name, DataColumn[] columns, bool primaryKey) 165public Constraint Add(string? name, DataColumn column, bool primaryKey) 180public Constraint Add(string? name, DataColumn primaryKeyColumn, DataColumn foreignKeyColumn) 191public Constraint Add(string? name, DataColumn[] primaryKeyColumns, DataColumn[] foreignKeyColumns) 198public void AddRange(Constraint[]? constraints) 209foreach (Constraint constr in constraints) 249private static bool AutoGenerated(Constraint constraint) 282private void ArrayAdd(Constraint constraint) 288private void ArrayRemove(Constraint constraint) 310private void BaseAdd(Constraint constraint) 326private void BaseGroupSwitch(Constraint[] oldArray, int oldLength, Constraint[] newArray, int newLength) 370private void BaseRemove(Constraint constraint) 406/// Indicates if a <see cref='System.Data.Constraint'/> can be removed. 409public bool CanRemove(Constraint constraint) 414internal bool CanRemove(Constraint constraint, bool fThrowException) 420/// Clears the collection of any <see cref='System.Data.Constraint'/> 444Constraint[] constraints = new Constraint[List.Count]; 449BaseGroupSwitch(constraints, oldLength, Array.Empty<Constraint>(), 0); 454BaseGroupSwitch(Array.Empty<Constraint>(), 0, constraints, oldLength); 468/// Indicates whether the <see cref='System.Data.Constraint'/>, specified by name, exists in the collection. 482return (name == ((Constraint)List[index]!).ConstraintName); 485public void CopyTo(Constraint[] array, int index) 495array[index + i] = (Constraint)_list[i]!; 502internal Constraint? FindConstraint(Constraint? constraint) 507if (((Constraint)List[i]!).Equals(constraint)) 508return (Constraint)List[i]!; 590/// Returns the index of the specified <see cref='System.Data.Constraint'/> . 592public int IndexOf(Constraint? constraint) 599if (constraint == (Constraint)List[i]!) 608/// Returns the index of the <see cref='System.Data.Constraint'/>, specified by name. 628Constraint constraint = (Constraint)List[i]!; 672if (NamesEqual(name, ((Constraint)List[i]!).ConstraintName, true, _table.Locale) != 0) 674throw ExceptionBuilder.DuplicateConstraintName(((Constraint)List[i]!).ConstraintName); 684/// Removes the specified <see cref='System.Data.Constraint'/> from the collection. 686public void Remove(Constraint constraint) 712Constraint c = this[index]; 723Constraint? c = this[name];
System\Data\ConstraintConverter.cs (1)
35if (destinationType == typeof(InstanceDescriptor) && value is Constraint)
System\Data\ConstraintEnumerator.cs (10)
16private Constraint? _currentObject; 26Constraint candidate; 46Debug.Assert(_constraints.Current is Constraint, "ConstraintEnumerator, contains object which is not constraint"); 47candidate = (Constraint)_constraints.Current; 57public Constraint GetConstraint() 64protected virtual bool IsValidCandidate(Constraint constraint) => true; 66protected Constraint? CurrentObject => _currentObject; 73protected override bool IsValidCandidate(Constraint constraint) => constraint is ForeignKeyConstraint; 93protected override bool IsValidCandidate(Constraint constraint) => 107protected override bool IsValidCandidate(Constraint constraint) =>
System\Data\DataColumnCollection.cs (1)
524Constraint constraint = en.GetConstraint();
System\Data\DataException.cs (2)
494public static Exception ExpressionAndConstraint(DataColumn column, Constraint constraint) => _Argument(SR.Format(SR.DataColumn_ExpressionAndConstraint, column.ColumnName, constraint.ConstraintName)); 669public static Exception TableInConstraint(DataTable table, Constraint constraint) => _Argument(SR.Format(SR.DataTable_InConstraint, table.TableName, constraint.ConstraintName));
System\Data\DataRelation.cs (1)
791foreach (Constraint cs in ChildTable.Constraints)
System\Data\DataSet.cs (1)
719Constraint constraint = constraints.GetConstraint();
System\Data\DataTable.cs (7)
531Constraint c = Constraints[i]; 1076foreach (Constraint constraint in Constraints) 1327foreach (Constraint constr in Constraints) 1495foreach (Constraint constraint in Constraints) 2463clone.Constraints.FindConstraint(clonedConstraint) is Constraint oldConstraint) 2472clone.Constraints.FindConstraint(clonedConstraint) is Constraint oldConstraint) 6600foreach (Constraint tempConstrain in sourceTable.Constraints)
System\Data\ForeignKeyConstraint.cs (2)
684internal override Constraint? Clone(DataSet destination) => Clone(destination, false); 686internal override Constraint? Clone(DataSet destination, bool ignorNSforTableLookup)
System\Data\Merger.cs (3)
474Constraint src = table.Constraints[i]; 475Constraint? dest = src.Clone(_dataSet, _IgnoreNSforTableLookup); 486Constraint? cons = dest.Table!.Constraints.FindConstraint(dest);
System\Data\UniqueConstraint.cs (2)
271internal override Constraint? Clone(DataSet destination) 276internal override Constraint? Clone(DataSet destination, bool ignorNSforTableLookup)
System\Data\xmlsaver.cs (2)
286foreach (Constraint constr in table.Constraints) 439foreach (Constraint cs in dt.Constraints)