Skip to content

[release/7.x] Fixes around IncludeExpression for ExecuteUpdate/Delete (#30571) - #30579

Merged
wtgodbe merged 1 commit into
dotnet:release/7.0from
roji:ExecuteUpdateIncludes
Apr 4, 2023
Merged

[release/7.x] Fixes around IncludeExpression for ExecuteUpdate/Delete (#30571)#30579
wtgodbe merged 1 commit into
dotnet:release/7.0from
roji:ExecuteUpdateIncludes

Conversation

@roji

@roji roji commented Mar 25, 2023

Copy link
Copy Markdown
Member

Fixes #30572
Fixes #30528
Backport of #30571

Description

When an owned entity or auto-include was defined on an entity type, this causes IncludeExpressions to be added to the query tree which interfere with ExecuteUpdate/Delete.

Customer impact

Using ExecuteUpdate/Delete against entities which have owned entities or auto-includes would fail in some major scenarios.

How found

Customer report on 7.0

Regression

No, ExecuteUpdate/Delete are new in 7.0.

Testing

Added regression tests.

Risk

Low: The fix is local to ExecuteUpdate/Delete and is simple. Quirks have been added.

* Fully prune IncludeExpression before ExecuteUpdate, not just for the
  property lambda
* Prune also non-owned Includes

Fixes dotnet#30572
Fixes dotnet#30528

(cherry picked from commit 4c6f854)
@roji
roji requested a review from maumar March 25, 2023 09:20
@rbhanda rbhanda modified the milestones: 7.0.5, 7.0.6 Mar 28, 2023
@wtgodbe
wtgodbe merged commit c3c1a40 into dotnet:release/7.0 Apr 4, 2023
@rbhanda rbhanda modified the milestones: 7.0.6, 7.0.7 Jun 1, 2023
@ajcvickers ajcvickers removed this from the 7.0.7 milestone Nov 14, 2023
@roji
roji deleted the ExecuteUpdateIncludes branch June 13, 2025 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants