ChangeTrackingStrategy Enum

Definition

Indicates how the context detects changes to properties for an instance of the entity type.

public enum ChangeTrackingStrategy
type ChangeTrackingStrategy = 
Public Enum ChangeTrackingStrategy
Inheritance
ChangeTrackingStrategy

Fields

ChangedNotifications 1

To use this strategy, the entity class must implement INotifyPropertyChanged. Original values are recorded when an entity is queried from the database. Properties are marked as modified when the entity raises the PropertyChanged event.

ChangingAndChangedNotifications 2

To use this strategy, the entity class must implement INotifyPropertyChanged and INotifyPropertyChanging. Original values are recorded when the entity raises the PropertyChanging event. Properties are marked as modified when the entity raises the PropertyChanged event.

Original values are only recorded when they are required to save changes to the entity. For example, properties that are configured as concurrency tokens.

ChangingAndChangedNotificationsWithOriginalValues 3

To use this strategy, the entity class must implement INotifyPropertyChanged and INotifyPropertyChanging. Original values are recorded when the entity raises the PropertyChanging. Properties are marked as modified when the entity raises the PropertyChanged event.

Original values are recorded for all properties, regardless of whether they are required to save changes to the entity.

Snapshot 0

Original values are recorded when an entity is queried from the database. Changes are detected by scanning the current property values and comparing them to the recorded values. This scanning takes place when DetectChanges() is called, or when another API call (such as SaveChanges()) triggers the change detection process.

Applies to