2 writes to _primaryKey
System.Data.Common (2)
System\Data\DataTable.cs (2)
1698
_primaryKey
= null;
1728
_primaryKey
= key;
38 references to _primaryKey
System.Data.Common (38)
System\Data\ConstraintCollection.cs (2)
109
if (Table.
_primaryKey
!= null)
772
if (_table.
_primaryKey
!= null)
System\Data\DataColumnCollection.cs (2)
477
if (_table.
_primaryKey
!= null && _table.
_primaryKey
.Key.ContainsColumn(column))
System\Data\DataTable.cs (23)
1633
UniqueConstraint? primayKeyConstraint =
_primaryKey
;
1685
if (key ==
_primaryKey
|| (key != null && key.Equals(
_primaryKey
)))
1697
UniqueConstraint? oldKey =
_primaryKey
;
1730
Debug.Assert(
_primaryKey
== null || Constraints.FindConstraint(
_primaryKey
) ==
_primaryKey
, "PrimaryKey is not in ConstraintCollection");
1733
if (
_primaryKey
!= null)
1749
private bool ShouldSerializePrimaryKey() =>
_primaryKey
!= null;
3032
if (
_primaryKey
== null) throw ExceptionBuilder.TableMissingPrimaryKey();
3038
return FindRow(
_primaryKey
!.Key, values);
3044
return FindRow(
_primaryKey
!.Key, value);
4619
if (
_primaryKey
!= null)
4621
_loadIndex =
_primaryKey
.Key.GetSortIndex(DataViewRowState.OriginalRows);
4750
if (
_primaryKey
!= null)
4757
_loadIndexwithCurrentDeleted =
_primaryKey
.Key.GetSortIndex(DataViewRowState.CurrentRows | DataViewRowState.Deleted);
4768
_loadIndexwithOriginalAdded =
_primaryKey
.Key.GetSortIndex(DataViewRowState.OriginalRows | DataViewRowState.Added);
4797
if (
_primaryKey
!= null)
4799
index =
_primaryKey
.Key.GetSortIndex(DataViewRowState.OriginalRows);
5015
if (
_primaryKey
!= null)
5018
primaryKeyIndex = new int[
_primaryKey
.ColumnsReference.Length];
5019
for (int i = 0; i <
_primaryKey
.ColumnsReference.Length; i++)
5021
primaryKeyIndex[i] =
_primaryKey
.ColumnsReference[i].Ordinal;
System\Data\Merger.cs (8)
204
if (!wasEmpty && dst.
_primaryKey
!= null)
209
ndxSearch = dst.
_primaryKey
.Key.GetSortIndex(DataViewRowState.OriginalRows | DataViewRowState.Added);
273
if (dst.
_primaryKey
!= null)
283
ndxSearch = new Index(dst, dst.
_primaryKey
!.Key.GetIndexDesc(), DataViewRowState.OriginalRows | DataViewRowState.Added, null);
628
if (src.
_primaryKey
!= null)
630
return src.
_primaryKey
.Key;
634
if (dst.
_primaryKey
!= null)
636
DataColumn[] dstColumns = dst.
_primaryKey
.Key.ColumnsReference;
System\Data\UniqueConstraint.cs (3)
187
if (Equals(constraints.Table.
_primaryKey
))
189
Debug.Assert(constraints.Table.
_primaryKey
== this, "If the primary key and this are 'Equal', they should also be '=='");
371
return (this == Table.
_primaryKey
);