-
Notifications
You must be signed in to change notification settings - Fork 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
Keyless entity without a table - broken in 7.0 #4144
Comments
To work around this, I had to change the configuration to: .ToTable(t => t.ExcludeFromMigrations()) I then had to modify the model snapshot and the designer for every existing migration to change: b.ToTable((string)null, t => t.ExcludeFromMigrations()); to: b.ToTable(t => t.ExcludeFromMigrations()); However, I have no idea whether this is the correct approach, or what side-effects this change will have. |
This is an unfortunate side effect of dotnet/efcore#19811. We'll need to document this as a breaking change |
@AndriySvyryd Thanks for the reply. How would I fix it for existing migrations? Is it enough to edit them to remove the |
Calling |
@AndriySvyryd For this specific entity, it's a private nested and sealed class used to represent the results of a |
Note from triage: document this as a breaking change. |
As per this thread, I have a keyless entity which is not mapped to a table or view:
This works perfectly in EF Core 6.0.
Immediately after upgrading to 7.0, when I try to add a migration, I get:
EF Core version: 7.0.0
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 6.0
Operating system: Windows 11 22H2
IDE: Visual Studio 2022 17.4
The text was updated successfully, but these errors were encountered: