Query: Update original and current values of tracked objects' unchanged properties (MergeOptions.PreserveChanges)
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
To use some ancient EF4 terminology, today's EF Core query behavior uses `MergeOptions.AppendOnly`. This means that new entities are materialized and attached to the state manager while any entities that already exist in the state manager (as identified by their key) are returned as is. This means that any new property values returned by the query are essentially discarded.
I would like the option of using the `PreserveChanges` behavior. This would update the original and current values of any existing entities' unchanged properties. This is obviously more computationally expensive, but I suspect it will be offset by the memory allocations saved in comparison to existing new-DbContext/NoTracking/ChangeTracker.Clear workarounds.
Contributor guide
Assessment
This issue has not been assessed yet.