You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
A validation was added for compiled queries and global query filters to detect unsupported constants. That incorrectly rejected EF.Constant and EF.Parameter when their argument is a property on the current DbContext. The fix permits only operands that have been transformed into a context accessor and preserves rejection for literal and other non-context operands.
Customer impact
Applications using tenant or similar context state in a global query filter cannot execute affected non-compiled queries on EF Core 11 RC1.
The query throws instead of applying the tenant filter. There is no practical workaround other than removing the explicit EF.Parameter or EF.Constant call.
How found
User reported on EF Core 11.0.0-rc1 in #39081. One customer report and one issue reaction indicate affected usage.
Regression
Yes, from EF 10.x. Introduced by #38155.
Testing
Tests added.
Risk
Low. The change is to revert to previous behavior in select cases.
CopilotAI
changed the title
[WIP] Fix regression for query filters in non-compiled queries
Allow EF.Parameter and EF.Constant on context properties in query filters
Sep 25, 2026
- Support EF.Constant and EF.Parameter on context properties\n- Preserve rejection for non-context operands\n\nFixes #39081\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
AndriySvyryd
changed the title
Allow EF.Parameter and EF.Constant on context properties in query filters
[release/11.0] Allow EF.Parameter and EF.Constant on context properties in query filters
Sep 25, 2026
HandleParameter is also used by EF.MultipleParameters (lines 969–973), so this relaxed guard enables context-backed MultipleParameters in query filters too. That behavior is outside the PR’s stated EF.Constant/EF.Parameter scope and has no acceptance or rejection coverage. Either retain the old rejection for MultipleParameters, or explicitly include it in scope and add equivalent context-property and literal tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #39081
Description
A validation was added for compiled queries and global query filters to detect unsupported constants. That incorrectly rejected
EF.ConstantandEF.Parameterwhen their argument is a property on the currentDbContext. The fix permits only operands that have been transformed into a context accessor and preserves rejection for literal and other non-context operands.Customer impact
Applications using tenant or similar context state in a global query filter cannot execute affected non-compiled queries on EF Core 11 RC1.
The query throws instead of applying the tenant filter. There is no practical workaround other than removing the explicit
EF.ParameterorEF.Constantcall.How found
User reported on EF Core 11.0.0-rc1 in #39081. One customer report and one issue reaction indicate affected usage.
Regression
Yes, from EF 10.x. Introduced by #38155.
Testing
Tests added.
Risk
Low. The change is to revert to previous behavior in select cases.