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
There is evidence to support that a common expectation is for this to get translated for server evaluation. However, since ToDictionary() is only defined over IEnumerable, EF Core cannot see the aggregate function and the grouping will in fact be performed client-side.
We can have an analyzer to detect this, and even suggest a quick fix of extracting the aggregate lambda inserting a Select() with it between the GroupBy and ToDictionary.
The text was updated successfully, but these errors were encountered:
I would love to see such an analyzer, we just fell into this trap and it was a pain to diagnose. Especially for ToDictionaryAsync since it comes from EF.Core.
We've had discussions in #16730 and offline about the following:
There is evidence to support that a common expectation is for this to get translated for server evaluation. However, since ToDictionary() is only defined over IEnumerable, EF Core cannot see the aggregate function and the grouping will in fact be performed client-side.
We can have an analyzer to detect this, and even suggest a quick fix of extracting the aggregate lambda inserting a Select() with it between the GroupBy and ToDictionary.
The text was updated successfully, but these errors were encountered: