Mixing sproc and non-sproc commands in the same batch may fail with a NullReferenceException #29643
Labels
area-save-changes
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
File a bug
Deleting a child entity when the parent entity uses DeleteUsingStoredProcedure fails with a NullReferenceException. It happens only when the child entity is already loaded in the entity tracker prior to deleting the parent entity.
Include your code
Repro project can be found here: https://github.com/maboivin/EFCoreIssueDeleteUsingStoredProcedure
Include stack traces
Include verbose output
SQL query executed when deleting the parent entity record:
Database contexts:
Include provider and version information
EF Core version: 7.0.0
Database provider: Microsoft.EntityFrameworkCore.SqlServer 7.0.0
Target framework: .NET 7.0
Operating system: Windows 11 21H2 (Build 22000.1219)
IDE: Visual Studio 2022 17.4.0
The text was updated successfully, but these errors were encountered: