diff --git a/XCode/Cache/FieldCache.cs b/XCode/Cache/FieldCache.cs index cbeb5609f..7c8c6cbc4 100644 --- a/XCode/Cache/FieldCache.cs +++ b/XCode/Cache/FieldCache.cs @@ -65,7 +65,12 @@ private void Init() } } - private IList Search() => Entity.FindAll(Where?.GroupBy(_field), OrderBy, _Unique.Count("group_count")! & _field, 0, MaxRows); + private IList Search() + { + Expression? exp = Where?.GroupBy(_field); + exp ??= _field.GroupBy(); + return Entity.FindAll(exp, OrderBy, _Unique.Count("group_count")! & _field, 0, MaxRows); + } private IDictionary GetAll() {