ChangeTrackingStrategy ChangeTrackingStrategy Enum

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

Syntax

Declaration

public enum ChangeTrackingStrategyPublic Enum ChangeTrackingStrategy

Fields

ChangedNotifications
ChangedNotifications

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

ChangingAndChangedNotifications
ChangingAndChangedNotifications

To use this strategy, the entity class must implement and . Original values are recorded when the entity raises the event. Properties are marked as modified when the entity raises the 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
ChangingAndChangedNotificationsWithOriginalValues

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

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

Snapshot
Snapshot

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.

Details

Assembly

Microsoft.EntityFrameworkCore.dll