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