private EntityKey GetPrimaryKeyValueChecked(InternalEntityEntry entry) { var keyValue = entry.GetPrimaryKeyValue(); if (keyValue == EntityKey.InvalidEntityKey) { throw new InvalidOperationException(Strings.InvalidPrimaryKey(entry.EntityType.Name)); } return(keyValue); }
public virtual void StopTracking(InternalEntityEntry entry) { if (entry.Entity != null) { _entityReferenceMap.Remove(entry.Entity); } var keyValue = entry.GetPrimaryKeyValue(); InternalEntityEntry existingEntry; if (_identityMap.TryGetValue(keyValue, out existingEntry) && existingEntry == entry) { _identityMap.Remove(keyValue); } }
private EntityKey GetPrimaryKeyValueChecked(InternalEntityEntry entry) { var keyValue = entry.GetPrimaryKeyValue(); if (keyValue == EntityKey.InvalidEntityKey) { // TODO: Check message text here throw new InvalidOperationException(Strings.InvalidPrimaryKey(entry.EntityType.Name)); } return keyValue; }
public virtual void StopTracking(InternalEntityEntry entry) { if (entry.Entity != null) { _entityReferenceMap.Remove(entry.Entity); } var keyValue = entry.GetPrimaryKeyValue(); InternalEntityEntry existingEntry; if (_identityMap.TryGetValue(keyValue, out existingEntry) && existingEntry == entry) { _identityMap.Remove(keyValue); } }