8 instantiations of ForeignKeyConstraint
System.Data.Common (8)
System\Data\ConstraintCollection.cs (3)
182
ForeignKeyConstraint constraint = new
ForeignKeyConstraint
(name, primaryKeyColumn, foreignKeyColumn);
193
ForeignKeyConstraint constraint = new
ForeignKeyConstraint
(name, primaryKeyColumns, foreignKeyColumns);
814
ForeignKeyConstraint newConstraint = new
ForeignKeyConstraint
(constr._constraintName, parents, childs);
System\Data\DataRelationCollection.cs (1)
811
relation.ChildTable.Constraints.Add(foreignKey = new
ForeignKeyConstraint
(relation.ParentColumnsReference, relation.ChildColumnsReference));
System\Data\DataTable.cs (1)
650
ForeignKeyConstraint fk = new
ForeignKeyConstraint
(constraintName, parentkeyColumns, childkeyColumns);
System\Data\ForeignKeyConstraint.cs (2)
742
ForeignKeyConstraint clone = new
ForeignKeyConstraint
(ConstraintName, relatedColumns, columns);
782
ForeignKeyConstraint clone = new
ForeignKeyConstraint
(ConstraintName, relatedColumns, columns);
System\Data\XMLSchema.cs (1)
1322
fkc = new
ForeignKeyConstraint
(name, pKey, fKey);
94 references to ForeignKeyConstraint
netstandard (1)
netstandard.cs (1)
532
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.
ForeignKeyConstraint
))]
System.Data (1)
src\libraries\shims\System.Data\ref\System.Data.cs (1)
98
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.
ForeignKeyConstraint
))]
System.Data.Common (92)
System\Data\ConstraintCollection.cs (16)
116
else if (constraint is
ForeignKeyConstraint
fk)
132
AddForeignKeyConstraint((
ForeignKeyConstraint
)constraint);
175
/// Constructs a new <see cref='System.Data.
ForeignKeyConstraint
'/>
182
ForeignKeyConstraint
constraint = new ForeignKeyConstraint(name, primaryKeyColumn, foreignKeyColumn);
188
/// Constructs a new <see cref='System.Data.
ForeignKeyConstraint
'/> with the specified parent columns and
193
ForeignKeyConstraint
constraint = new ForeignKeyConstraint(name, primaryKeyColumns, foreignKeyColumns);
240
private void AddForeignKeyConstraint(
ForeignKeyConstraint
constraint)
251
ForeignKeyConstraint
? fk = (constraint as
ForeignKeyConstraint
);
394
else if (constraint is
ForeignKeyConstraint
)
548
internal
ForeignKeyConstraint
? FindForeignKeyConstraint(DataColumn[] parentColumns, DataColumn[] childColumns)
553
ForeignKeyConstraint
? constraint = (List[i] as
ForeignKeyConstraint
);
788
ForeignKeyConstraint
constr = (
ForeignKeyConstraint
)_delayLoadingConstraints[i];
814
ForeignKeyConstraint
newConstraint = new ForeignKeyConstraint(constr._constraintName, parents, childs);
System\Data\ConstraintConverter.cs (3)
48
ForeignKeyConstraint
constr = (
ForeignKeyConstraint
)value;
50
typeof(
ForeignKeyConstraint
).GetConstructor(new Type[] { typeof(string), typeof(string), typeof(string[]),
System\Data\ConstraintEnumerator.cs (7)
73
protected override bool IsValidCandidate(Constraint constraint) => constraint is
ForeignKeyConstraint
;
75
public
ForeignKeyConstraint
GetForeignKeyConstraint()
79
return (
ForeignKeyConstraint
)CurrentObject;
94
((constraint is
ForeignKeyConstraint
) && (((
ForeignKeyConstraint
)constraint).Table == _table));
108
((constraint is
ForeignKeyConstraint
) && (((
ForeignKeyConstraint
)constraint).RelatedTable == _table));
System\Data\DataColumnCollection.cs (1)
525
if (((
ForeignKeyConstraint
)constraint).ParentKey.ContainsColumn(column))
System\Data\DataException.cs (2)
460
public static Exception NeededForForeignKeyConstraint(UniqueConstraint key,
ForeignKeyConstraint
fk) => _Argument(SR.Format(SR.DataConstraint_NeededForForeignKeyConstraint, key.ConstraintName, fk.ConstraintName));
470
public static Exception RemoveParentRow(
ForeignKeyConstraint
constraint) => _InvalidConstraint(SR.Format(SR.DataConstraint_RemoveParentRow, constraint.ConstraintName));
System\Data\DataRelation.cs (6)
47
private
ForeignKeyConstraint
? _childKeyConstraint;
486
ForeignKeyConstraint
? constraint = ChildTable.Constraints.FindForeignKeyConstraint(ChildKey.ColumnsReference, ParentKey.ColumnsReference);
601
/// Gets the <see cref='System.Data.
ForeignKeyConstraint
'/> for the relation.
603
public virtual
ForeignKeyConstraint
? ChildKeyConstraint
624
internal void SetChildKeyConstraint(
ForeignKeyConstraint
? value)
793
if (cs is
ForeignKeyConstraint
fk)
System\Data\DataRelationCollection.cs (1)
806
ForeignKeyConstraint
? foreignKey = relation.ChildTable.Constraints.FindForeignKeyConstraint(relation.ParentColumnsReference, relation.ChildColumnsReference);
System\Data\DataSet.cs (9)
1190
ForeignKeyConstraint
foreign = (
ForeignKeyConstraint
)constraints[j];
3296
if (cons[j] is
ForeignKeyConstraint
)
3332
ForeignKeyConstraint
? constraint;
3339
if (constraints[j] is
ForeignKeyConstraint
)
3341
constraint = (
ForeignKeyConstraint
)constraints[j];
3372
ForeignKeyConstraint
? constraint;
3379
if (constraints[j] is
ForeignKeyConstraint
)
3381
constraint = (
ForeignKeyConstraint
)constraints[j];
System\Data\DataTable.cs (14)
553
ForeignKeyConstraint
? fk = c as
ForeignKeyConstraint
;
650
ForeignKeyConstraint
fk = new ForeignKeyConstraint(constraintName, parentkeyColumns, childkeyColumns);
2456
ForeignKeyConstraint
? foreign = Constraints[j] as
ForeignKeyConstraint
;
2462
if (foreign.Clone(clone) is
ForeignKeyConstraint
clonedConstraint &&
2488
ForeignKeyConstraint
? foreign = Constraints[j] as
ForeignKeyConstraint
;
2493
foreign.Clone(clone) is
ForeignKeyConstraint
newforeign)
2859
ForeignKeyConstraint
constraint = constraints.GetForeignKeyConstraint();
6602
ForeignKeyConstraint
? fkc = tempConstrain as
ForeignKeyConstraint
; // we have already cloned the UKC when cloning the datatable
6609
ForeignKeyConstraint
newFKC = (
ForeignKeyConstraint
)fkc.Clone(destinationTable.DataSet!)!;
System\Data\DataTableCollection.cs (2)
416
ForeignKeyConstraint
constraint = constraints.GetForeignKeyConstraint();
433
ForeignKeyConstraint
constraint = constraints.GetForeignKeyConstraint();
System\Data\ForeignKeyConstraint.cs (11)
39
/// Initializes a new instance of the <see cref='System.Data.
ForeignKeyConstraint
'/> class with the specified parent and
47
/// Initializes a new instance of the <see cref='System.Data.
ForeignKeyConstraint
'/> class with the specified name,
58
/// Initializes a new instance of the <see cref='System.Data.
ForeignKeyConstraint
'/> class with the specified arrays
66
/// Initializes a new instance of the <see cref='System.Data.
ForeignKeyConstraint
'/> class with the specified name,
742
ForeignKeyConstraint
clone = new ForeignKeyConstraint(ConstraintName, relatedColumns, columns);
757
internal
ForeignKeyConstraint
? Clone(DataTable destination)
782
ForeignKeyConstraint
clone = new ForeignKeyConstraint(ConstraintName, relatedColumns, columns);
855
/// Gets a value indicating whether the current <see cref='System.Data.
ForeignKeyConstraint
'/> is identical to the specified object.
859
if (!(key is
ForeignKeyConstraint
))
863
ForeignKeyConstraint
key2 = (
ForeignKeyConstraint
)key;
System\Data\Rule.cs (1)
7
/// Indicates the action that occurs when a <see cref='System.Data.
ForeignKeyConstraint
'/>
System\Data\UniqueConstraint.cs (1)
197
ForeignKeyConstraint
constraint = cs.GetForeignKeyConstraint();
System\Data\xmlsaver.cs (14)
100
else if (type == typeof(
ForeignKeyConstraint
))
290
if (constr is
ForeignKeyConstraint
)
292
if (!_tables.Contains(((
ForeignKeyConstraint
)constr).RelatedTable))
441
ForeignKeyConstraint
? fk = (cs as
ForeignKeyConstraint
);
1684
private static bool AutoGenerated(
ForeignKeyConstraint
fk)
1689
internal static bool AutoGenerated(
ForeignKeyConstraint
fk, bool checkRelation)
2067
else if (constraints[i] is
ForeignKeyConstraint
&& genNested)
2069
ForeignKeyConstraint
foreign = (
ForeignKeyConstraint
)constraints[i];
2148
AddExtendedProperties(foreign._extendedProperties, constraint, typeof(
ForeignKeyConstraint
));
2174
if (foreign.AcceptRejectRule !=
ForeignKeyConstraint
.AcceptRejectRule_Default)
2178
if (foreign.UpdateRule !=
ForeignKeyConstraint
.Rule_Default)
2181
if (foreign.DeleteRule !=
ForeignKeyConstraint
.Rule_Default)
System\Data\XMLSchema.cs (4)
337
if (instance is
ForeignKeyConstraint
)
1261
return
ForeignKeyConstraint
.AcceptRejectRule_Default;
1275
return
ForeignKeyConstraint
.Rule_Default;
1309
ForeignKeyConstraint
? fkc = null;