-
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
ForSqlServerInclude does not respect column mapping #14087
Comments
Are there plans to fix this in 2.2? or only for 3.0? I ran into the same issue. I even tried passing a string array (as opposed to the lambda expression), and it failed as well.
|
@NArnott We don't currently have any plans to port this back to 2.2. The workaround is to edit your migration to correct the error. |
@ajcvickers That works. I tried entering the column names manually on the ModelBuilder side, but that broke due to some "validation" failure. I didn't think to fix the migration itself after generation, but it appears to works. Thx. |
What's the current situation regarding this bug? It has 3.0.0 milestone - is this being worked on? If not, I'd like to volunteer to work on this. From what I'm seeing in
Any thoughts on this fix? |
We need to resolve the column names sooner than that. This code needs to be updated from property names to column names: |
@mirol-h Feel free to send a PR |
…erties, resolve properties to column names. Fixes dotnet#14087
Done. It does seem weird to have one annotation have different meaning in context of model ( |
In hindsight, I would separate the names for model and migrations annotations, but 🤷♂️ probably not worth it at this point |
…erties, resolve properties to column names. Fixes dotnet#14087
…erties, resolve properties to column names. Fixes dotnet#14087
…erties, resolve properties to column names. Fixes dotnet#14087
…erties, resolve properties to column names. Fixes dotnet#14087
…erties, resolve properties to column names. Fixes dotnet#14087
This failed when the column name wasn't the same as the property name. Fixes #1201 Same as dotnet/efcore#14087 for SQL Server.
This failed when the column name wasn't the same as the property name. Fixes #1201 Same as dotnet/efcore#14087 for SQL Server.
This failed when the column name wasn't the same as the property name. Fixes #1201 Same as dotnet/efcore#14087 for SQL Server.
This failed when the column name wasn't the same as the property name. Fixes #1201 Same as dotnet/efcore#14087 for SQL Server. (cherry picked from commit 09943c6)
Steps to reproduce
For this model and mapping:
is created a migration
See the difference: column: "SomeTableValue1" vs Annotation(..."Value2" }).
When scripted, a broken SQL Script is generated (column Value2 used in the index does not exists in the table).
Further technical details
EF Core version: 2.2.0
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
The text was updated successfully, but these errors were encountered: