EFCore 6 - NullReferenceException upon EnsureDeleted #26436
Labels
area-model-building
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
regression
Servicing-approved
type-bug
Milestone
I have a sample application which used to work with EFCore 5 sql server provider. But with EFCore 6 rc2, I am getting null reference exception when executing EnsureDeleted().
Here is the sample application
Here is the stacktrace of error
I suppose this is negative scenario since Data Annotation and fluent API used for foreign key are conflicting. But since fluent API takes precedence data annotation, there should not be any error. As it used to work in EFCore 5.
Is this an actual issue or expected behavior.
If this is an issue, when can we expect it to get fixed.
If this is an expected behavior, can we have more meaningful error message instead of null reference exception?
Please could someone clarify.
provider and version information
EF Core version: 6.0.0-rc.2.21480.5
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 6.0
Operating system: Windows 10
IDE: Visual Studio 2022 preview
The text was updated successfully, but these errors were encountered: