Exclude specific property from change tracking
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
Research direction
Start by examining EF Core's change-tracking behavior for geometry properties and how Metadata.AfterSaveBehaviour interacts with it. Reproduce the reported SaveChanges delay and verify whether a property can be excluded from standard tracking while still being manually marked modified with IsModified. Done means the requested behavior is clearly supported or the limitation is documented.
Written by the indexing model from the issue text.
Description
I have an entity with a geometry column which causes SaveChanges to take a long time (>1min) whenever the entities are tracked - presumably due to having to compare geometries to determine whether they have changed. Due to other areas of the project making use of lazy loading, I can't turn change tracking off globally and so I have to make sure to use AsNoTracking everywhere this particular entity type is used (including queries that Include them) which is proving a bit of a pain. I tried setting Metadata.AfterSaveBehaviour to PropertySaveBehaviour.Ignore but this seems to still attempt to track changes to the property even though it would then (I believe) ignore any changes it found.
Is there any way to exclude the particular property from change tracking? If AfterSaveBehaviour set to Ignore worked as one might expect this would be a start but ideally there should be some way of excluding the property in standard change tracking but still allow it to be manually mark as modified (using IsModified which I assume (although I haven't tested this) would still cause a property to be ignore when setting AfterSaveBehaviour).
- 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