Get the count of items in a GroupBy Linq-to-sql Query?
- by Curtis White
I have a groupby that I groups all elements. I can see the items are there in LinqPad but can't find a way to get the count.
Here is what I have so far:
SurveyResponses.Where( q = q.QuestionId == 4).GroupBy(q = q.AnswerNumeric).Where( g = g.Key == 1)
In Linq Pad I can see there are 4 items in this query. If I do Count it returns 1. I've tried, ToList().Count, Select(x = x).Count, etc.