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)
109if (Table._primaryKey != null) 772if (_table._primaryKey != null)
System\Data\DataColumnCollection.cs (2)
477if (_table._primaryKey != null && _table._primaryKey.Key.ContainsColumn(column))
System\Data\DataTable.cs (23)
1628UniqueConstraint? primayKeyConstraint = _primaryKey; 1680if (key == _primaryKey || (key != null && key.Equals(_primaryKey))) 1692UniqueConstraint? oldKey = _primaryKey; 1725Debug.Assert(_primaryKey == null || Constraints.FindConstraint(_primaryKey) == _primaryKey, "PrimaryKey is not in ConstraintCollection"); 1728if (_primaryKey != null) 1744private bool ShouldSerializePrimaryKey() => _primaryKey != null; 3027if (_primaryKey == null) throw ExceptionBuilder.TableMissingPrimaryKey(); 3033return FindRow(_primaryKey!.Key, values); 3039return FindRow(_primaryKey!.Key, value); 4614if (_primaryKey != null) 4616_loadIndex = _primaryKey.Key.GetSortIndex(DataViewRowState.OriginalRows); 4745if (_primaryKey != null) 4752_loadIndexwithCurrentDeleted = _primaryKey.Key.GetSortIndex(DataViewRowState.CurrentRows | DataViewRowState.Deleted); 4763_loadIndexwithOriginalAdded = _primaryKey.Key.GetSortIndex(DataViewRowState.OriginalRows | DataViewRowState.Added); 4792if (_primaryKey != null) 4794index = _primaryKey.Key.GetSortIndex(DataViewRowState.OriginalRows); 5010if (_primaryKey != null) 5013primaryKeyIndex = new int[_primaryKey.ColumnsReference.Length]; 5014for (int i = 0; i < _primaryKey.ColumnsReference.Length; i++) 5016primaryKeyIndex[i] = _primaryKey.ColumnsReference[i].Ordinal;
System\Data\Merger.cs (8)
204if (!wasEmpty && dst._primaryKey != null) 209ndxSearch = dst._primaryKey.Key.GetSortIndex(DataViewRowState.OriginalRows | DataViewRowState.Added); 273if (dst._primaryKey != null) 283ndxSearch = new Index(dst, dst._primaryKey!.Key.GetIndexDesc(), DataViewRowState.OriginalRows | DataViewRowState.Added, null); 628if (src._primaryKey != null) 630return src._primaryKey.Key; 634if (dst._primaryKey != null) 636DataColumn[] dstColumns = dst._primaryKey.Key.ColumnsReference;
System\Data\UniqueConstraint.cs (3)
187if (Equals(constraints.Table._primaryKey)) 189Debug.Assert(constraints.Table._primaryKey == this, "If the primary key and this are 'Equal', they should also be '=='"); 371return (this == Table._primaryKey);