Skip to content
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

Support ExecuteUpdate/Delete with view mapping where the column name differs between the table and view #34713

Open
roji opened this issue Sep 19, 2024 · 0 comments
Assignees
Milestone

Comments

@roji
Copy link
Member

roji commented Sep 19, 2024

When ExecuteUpdate/Delete is executed on a table that has a view mapping, special rewriting of the query expression must be done, as the translation references the view but we need to update the table instead (see #34677). This was done in #34709, but without handling the case where column names actually differ between the two mapings:

modelBuilder.Entity<Cat>()
    .ToTable("Cat", b => b.Property(c => c.Name).HasColumnName("Name"))
    .ToView("CatView", b => b.Property(c => c.Name).HasColumnName("ViewName"));

To support this, we need to re-visit the expression, rewriting ColumnExpressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant