Support OriginalValues and GetDatabaseValues for shared entity entries
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the owned-entity replacement scenario with EF Core 2.2.6 and the Pomelo 2.2.6 provider, focusing on OriginalValues and GetDatabaseValues before SaveChanges. Done means both APIs expose the persisted original owned-entity values rather than the replacement instance.
Written by the indexing model from the issue text.
Description
I'm in the process of creating an audit log for changed entities/properties but I cannot seem to get original values from an Owned Entity property once that Owned Entity has been replaced by a new instance.
Some of my Entities have properties which are Value Object / Owned Entities (and some of those have nested owned entities). I seem to have hit a blocker whereby I cannot retrieve the old value of an owned entity property once the owning Entity has replaced the owned entity with a new one.
The Owned Entity OriginalValues collection or the call to .GetDatabaseValues() returns the new Owned Entity instance, not the original one as is in the database (n.b. saveChanges has not yet been called).
It is possible to get the original values of an owned entity, even when the owned entity has been replaced by a new instance of that type?
EF Core version: 2.2.6
Database provider: Pomelo (v.2.2.6)
Target framework: .NET Framework 4.6
Operating system: Win 10
IDE: Visual Studio 2019 16.4.1
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 134
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/efcore
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
customer-reported
Difficulty 5/5 Over a week Newbie friendliness 38/100
-
area-cosmos area-vector-search
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
area-cosmos
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
area-tools needs-design
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100