2 writes to _primaryKey
System.Data.Common (2)
System\Data\DataTable.cs (2)
1693
_primaryKey
= null;
1723
_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)
1628
UniqueConstraint? primayKeyConstraint =
_primaryKey
;
1680
if (key ==
_primaryKey
|| (key != null && key.Equals(
_primaryKey
)))
1692
UniqueConstraint? oldKey =
_primaryKey
;
1725
Debug.Assert(
_primaryKey
== null || Constraints.FindConstraint(
_primaryKey
) ==
_primaryKey
, "PrimaryKey is not in ConstraintCollection");
1728
if (
_primaryKey
!= null)
1744
private bool ShouldSerializePrimaryKey() =>
_primaryKey
!= null;
3027
if (
_primaryKey
== null) throw ExceptionBuilder.TableMissingPrimaryKey();
3033
return FindRow(
_primaryKey
!.Key, values);
3039
return FindRow(
_primaryKey
!.Key, value);
4614
if (
_primaryKey
!= null)
4616
_loadIndex =
_primaryKey
.Key.GetSortIndex(DataViewRowState.OriginalRows);
4745
if (
_primaryKey
!= null)
4752
_loadIndexwithCurrentDeleted =
_primaryKey
.Key.GetSortIndex(DataViewRowState.CurrentRows | DataViewRowState.Deleted);
4763
_loadIndexwithOriginalAdded =
_primaryKey
.Key.GetSortIndex(DataViewRowState.OriginalRows | DataViewRowState.Added);
4792
if (
_primaryKey
!= null)
4794
index =
_primaryKey
.Key.GetSortIndex(DataViewRowState.OriginalRows);
5010
if (
_primaryKey
!= null)
5013
primaryKeyIndex = new int[
_primaryKey
.ColumnsReference.Length];
5014
for (int i = 0; i <
_primaryKey
.ColumnsReference.Length; i++)
5016
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
);