GroupBy in EF Core 3.1 / EF Core 5.0 not working, even for the simplest example

Earlier EF/EF core automatically converted to client-side query evaluation when server-side evaluation was not possible.

Grouping by a key without select is not something supported by SQL and would always have been a client-side operation.

With EF 3.0+, they made it explicit on which query should run on server or on client. Technically it is better to explicitly know which query will run on server and what will run on client rather than a framework deciding it on our behalf.

You can read more about it here:
https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-3.x/breaking-changes#linq-queries-are-no-longer-evaluated-on-the-client

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)