Skip to content

Fix connection ordering check when Include() strips IOrderedQueryable…#1262

Merged
SimonCropp merged 1 commit intoSimonCropp:mainfrom
gbiellem:fix-connection-ordering-with-includes
Mar 26, 2026
Merged

Fix connection ordering check when Include() strips IOrderedQueryable…#1262
SimonCropp merged 1 commit intoSimonCropp:mainfrom
gbiellem:fix-connection-ordering-with-includes

Conversation

@gbiellem
Copy link
Contributor

Hey Simon

Connection queries break with "Connections require ordering" when the entity has read-only properties. Projection bails on read-only props, falls back to AddIncludes, and .Include() strips IOrderedQueryable even though the ordering is still in the expression tree.

Fix:
When the is IOrderedQueryable check fails, walk the expression tree for OrderBy/OrderByDescending.

I've add some Tests and add ReadOnlyEntity test data to reproduce it.

@SimonCropp SimonCropp merged commit 334abdc into SimonCropp:main Mar 26, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants