Repository navigation
Fix query precompiler rejecting ThenInclude sources - #39297
Open
AndriySvyryd with Copilot wants to merge 4 commits into
Open
AndriySvyryd with Copilot wants to merge 4 commits into
AndriySvyryd with Copilot wants to merge 4 commits into
Conversation
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Non-IQueryable first parameter for ThenInclude
Fix query precompiler rejecting ThenInclude sources
Oct 16, 2026
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues were identified.
No open issues 🎉
What changed in this PR
Fixes precompiled query generation for ThenInclude chains with multi-generic source types.
Changes:
- Supports multi-argument
IIncludableQueryablesources. - Adds comprehensive sync/async and chained
ThenIncluderegression tests. - Adds SQL Server baselines and guidance.
| File | Description |
|---|---|
test/EFCore.SqlServer.FunctionalTests/Query/AdHocPrecompiledQuerySqlServerTest.cs |
Adds SQL Server baselines. |
test/EFCore.Relational.Specification.Tests/Query/AdHocPrecompiledQueryRelationalTestBase.cs |
Adds ThenInclude regression coverage. |
src/EFCore.Design/Query/Internal/PrecompiledQueryCodeGenerator.cs |
Supports multi-generic ThenInclude sources. |
.agents/skills/query-pipeline/SKILL.md |
Documents precompiled include-chain guidance. |
Review effort: Lite
Code coverage overviewLanguages: C# C# / code-coverage
View coverage of the 10 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Query precompilation throws
Non-IQueryable first parameterforThenIncludebecause interceptor generation expects exactly one source type argument.IIncludableQueryable<TEntity, TPreviousProperty>has two.ThenIncludecalls, and sync/async execution through generated-code compilation and execution. Add SQL Server baselines.