Skip to content
Discussion options

You must be logged in to vote

Thanks for the detailed write-up — this is a very common pain point when combining QuickGrid + EF Core + server-side sorting/paging + projections.

Key idea: keep sorting/paging on the entity query, not on the projected type

EF Core can only translate an OrderBy if it can trace it back to a SQL-translatable expression. Once you project to a DTO/record that contains computed/non-translatable members (or the grid generates an OrderBy over something EF can’t bind back to SQL), you’ll hit the classic “could not be translated” errors.

The most robust pattern is:

  1. Start from IQueryable<TEntity> (e.g., db.Customers.AsNoTracking()).
  2. Apply filters to the entity query.
  3. Apply sorting to the entity qu…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mikermnv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area-blazor Includes: Blazor, Razor Components
2 participants