There are two ways to do this:
Process grouping on client
First create a group by age, as described, then use linq for the objects in the result to match the age with the age range, and then group by age range. See Grouping by an integer range of variables using Linq
Process grouping on server
Define a storage procedure that binds age to an age range (for example, returns 0 for ages 0 to 13, 1 for 14-19, etc.), and then use this storage procedure in your query.
source share