Detect via ChangeTracker if a modified CollectionEntry was added or removed

Open
#24,129 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp
Domain
database

Research direction

Start with the CollectionEntry and ChangeTracker behavior described in the issue, then review the linked change-tracking documentation and related issues, including #9237, #9312, and #10093. Define whether the API should distinguish additions from removals and what a completed, documented behavior would be.

Written by the indexing model from the issue text.

Description

area-change-tracking customer-reported needs-design

This is fairly straightforward to do for non-collection properties (see https://github.com/dotnet/efcore/issues/9237#issuecomment-317115094).

For a CollectionEntry, it looks like the IsModified is set to true correctly when an item is added or removed from a collection, however there doesn't seem to be a way to tell if it was added or removed, only that something changed.

I've looked through the docs, including here and here, and through issues, including https://github.com/dotnet/efcore/issues/9312 and https://github.com/dotnet/efcore/issues/10093 but haven't found a solution. Is this currently possible? If not, is there any plan to do so?

Dominant language
C#
Stars
14.8k
Forks
3.4k
Avg merge
2d 5h
Merged PRs (30d)
134

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/efcore

All issues in dotnet/efcore

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.