-
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
Deletion can cause error "The association between entity types A and B has been severed..." #30122
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
Servicing-approved
type-bug
Milestone
Comments
Note for triage: looks like a regression when entities deleted due to changes in one relationship are then also severed by changes in another relationship. @edwiles Workaround is to call |
Thanks @ajcvickers , that workaround is working for our real code. Would appreciate a fix when you can. |
ajcvickers
added a commit
that referenced
this issue
Jan 31, 2023
…inished Fixes #30122 Because the entities for which the relationship is being severed may end up being deleted later on in SaveChanges.
ajcvickers
added
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
Jan 31, 2023
ajcvickers
changed the title
.NET 7 regression: Deletion can cause error "The association between entity types A and B has been severed etc."
Deletion can cause error "The association between entity types A and B has been severed..."
Mar 14, 2023
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
Servicing-approved
type-bug
When multiple cascade paths have been avoided by setting one path to
DeleteBehavior.Restrict
, deletion can fail with the error:The code below runs successfully with EF Core 6.0.13, but fails with 7.0.0-7.0.2.
Steps to reproduce
.csproj
file that uses EF Core 6.Model.cs
:Program.cs
:The program returns successfully, without output.
.csproj
file to upgrade to EF Core 7:The program execution fails with the error:
Further technical details
EF Core version: 7.0.2
.NET SDK: 7.0.100
Database Provider: Microsoft.EntityFrameworkCore.Sqlite (though in our "real" code we use SqlServer)
Operating system: Windows 10 Enterprise
IDE: Visual Studio 17.4.2
The text was updated successfully, but these errors were encountered: