Closed danstur closed 5 years ago
@danstur Another workaround is to apply SiteTypeConfiguration
first.
Unfortunately fixing this in a patch release would be too risky.
Seems that we missed this case in https://github.com/aspnet/EntityFrameworkCore/pull/13720
There's a breaking change between EF Core 2.1 and 2.2.
It seemed easier to create a quick repo with a minimal example that demonstrates the issue than to inline all the code here. See this repository. If that's problematic for some reason, I can certainly also upload the code directly here.
The issue seems to stem from shadow properties in combination with HasForeignKey.
Steps to reproduce
git clone https://github.com/danstur/EfCoreBreakingChange.git
CreateDb.sql
on SQL Server 2017 (the real issue occurs at least on 2016 as well, but I only tested the minimal sample on my 2017 install - probably DB independent).Workarounds
builder.Property<int>("SenderId");
to theOutboundDeliveryTypeConfiguration
fixes the issue as expected..HasForeignKey("SenderId")
also fixes the issue. This one seems like an unintended interaction.Further technical details
EF Core version: 2.2 Database Provider: Microsoft.EntityFrameworkCore.SqlServer Operating system: Windows 10 x64 1803 IDE: Visual Studio 2017 15.9.3