-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get an EntityEntry<TEntity> for Shared Entity Types #25354
Labels
area-change-tracking
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-enhancement
Milestone
Comments
Try |
Note for triage: Attach will always track the entity instance. We should consider an overload of "Entry" that takes the shared type name. This would return an EntityEntry without necessarily tracking it, such that things like shadow PKs can be set before starting to track. |
Consider an |
ajcvickers
added
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
Jul 14, 2022
ajcvickers
added a commit
that referenced
this issue
Jul 14, 2022
…instances Fixes #25354 Also added some tests and fixed a couple of other issues with using shared-type entity type instances with tracking, etc.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-change-tracking
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-enhancement
Get an EntityEntry for Shared Entity Types
Right now, it is impossible to access an EntityEntry (via
Context.Entry(obj)
) for a SharedEntity and this prevents us from changing states of entries.(Not really necessary to understand the issue, but I need to access the EntityEntry of the shared entity because I want to set the state of the shared entity to Added while keeping related entities to Unchanged)
Reproducible example
Stack Traces
Include provider and version information
EF Core version: 5.0.8
Database provider: Microsoft.EntityFrameworkCore.Sqlite 5.0.8 & Npgsql.EntityFrameworkCore.PostgreSQL 5.0.7
Target framework: NET 5.0
Operating system: Linux
IDE: Rider
The text was updated successfully, but these errors were encountered: