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
I have a paginated list (grouped to take the first N items), and when I try query.Count(), it throws an exception and does not query the database
varquery= context.People
.Include(e => e.Shoes).GroupBy(e => e.Id).Select(g =>{PeopleId=g.key,Count=g.Shoes.Count(),Top2List= g.Shoes.take(2)});varcount=query.Count()//Throw exception Nullable object must have a value.
var list =query.ToList()// can be queried
var list2=query.Skip(0).Take(10).ToList()// can be queried
The text was updated successfully, but these errors were encountered:
ByZhouhang
changed the title
EF 6 GroupBy select Top N Query Count() Throw Exception
EF 6 .0 GroupBy select Top N Query Count() Throw Exception
Jul 1, 2022
Include your code
I see in the documentation that ef6.0 support for GroupBy queries
https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-6.0/whatsnew#improved-groupby-support
I have a paginated list (grouped to take the first N items), and when I try query.Count(), it throws an exception and does not query the database
The text was updated successfully, but these errors were encountered: