Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
ChangeTrackingStrategy Enum
Definition
- Namespace:
- Microsoft.EntityFrameworkCore
- Assembly:
- Microsoft.EntityFrameworkCore.dll
- Package:
- Microsoft.EntityFrameworkCore v10.0.0
- Package:
- Microsoft.EntityFrameworkCore v2.0.3
- Package:
- Microsoft.EntityFrameworkCore v2.1.11
- Package:
- Microsoft.EntityFrameworkCore v2.2.6
- Package:
- Microsoft.EntityFrameworkCore v3.0.0
- Package:
- Microsoft.EntityFrameworkCore v3.1.0
- Package:
- Microsoft.EntityFrameworkCore v5.0.0
- Package:
- Microsoft.EntityFrameworkCore v6.0.0
- Package:
- Microsoft.EntityFrameworkCore v7.0.0
- Package:
- Microsoft.EntityFrameworkCore v8.0.0
- Package:
- Microsoft.EntityFrameworkCore v9.0.0
- Source:
- ChangeTrackingStrategy.cs
- Source:
- ChangeTrackingStrategy.cs
- Source:
- ChangeTrackingStrategy.cs
- Source:
- ChangeTrackingStrategy.cs
Important
Some information relates to prerelease product that may be substantially modified before itβs released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
| Name | Value | Description |
|---|---|---|
| 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. |
| 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. |
| 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. |
Remarks
See Change detection and notifications for more information and examples.
Applies to
Entity Framework
Feedback
Was this page helpful?
