最佳答案
我有以下实体框架核心3.0查询:
var units = await context.Units
.SelectMany(y => y.UnitsI18N)
.OrderBy(y => y.Name)
.GroupBy(y => y.LanguageCode)
.ToDictionaryAsync(y => y.Key, y => y.Select(z => z.Name));
我得到以下错误:
Client side GroupBy is not supported.
要在客户机上运行查询,或者部分运行查询,我将执行以下操作:
var units = context.Units
.SelectMany(y => y.UnitsI18N)
.OrderBy(y => y.Name)
.AsEnumerable()
.GroupBy(y => y.LanguageCode)
.ToDictionary(y => y.Key, y => y.Select(z => z.Name));
现在成功了。
如果没有在客户端上运行查询,为什么会出现这个错误?