private void DetectPropertyChanges(InternalEntityEntry entry) { var entityType = entry.EntityType; if (entityType.HasPropertyChangedNotifications()) { return; } var snapshot = entry.TryGetSidecar(Sidecar.WellKnownNames.OriginalValues); if (snapshot == null) { return; } foreach (var property in entityType.GetProperties()) { if (property.GetOriginalValueIndex() >= 0 && !Equals(entry[property], snapshot[property])) { entry.SetPropertyModified(property); } } }
public virtual void PropertyChanged(InternalEntityEntry entry, IPropertyBase propertyBase) { var snapshot = entry.TryGetSidecar(Sidecar.WellKnownNames.RelationshipsSnapshot); var property = propertyBase as IProperty; if (property != null) { entry.SetPropertyModified(property); if (snapshot != null) { DetectKeyChange(entry, property, snapshot); } } else { var navigation = propertyBase as INavigation; if (navigation != null && snapshot != null) { DetectNavigationChange(entry, navigation, snapshot); } } }
private static void DetectPropertyChanges(InternalEntityEntry entry) { var entityType = entry.EntityType; if (entityType.HasPropertyChangedNotifications()) { return; } foreach (var property in entityType.GetProperties()) { if ((property.GetOriginalValueIndex() >= 0) && !Equals(entry[property], entry.GetOriginalValue(property))) { entry.SetPropertyModified(property); } } }
public virtual void PropertyChanged(InternalEntityEntry entry, IPropertyBase propertyBase) { var property = propertyBase as IProperty; if (property != null) { entry.SetPropertyModified(property); if (property.GetRelationshipIndex() != -1) { DetectKeyChange(entry, property); } } else { var navigation = propertyBase as INavigation; if (navigation != null) { DetectNavigationChange(entry, navigation); } } }