like the title said I have to group by age and gender but I get this error message:
At least one object must implement IComparable
var ageStats = vModel
.GroupBy(l => new { Age = 10 * (l.Age / 10), l.GenderName })
.OrderBy(x => x.Key)
.Select(g => new
{
Name = g.Key,
Count = g.Select(l => l.Age).Count()
})
.ToList();
If I group by age only like that it will work .GroupBy(l => 10 * (l.Age / 10))
but I won't have the gender.