I have the following two tables
Groups
- Id
- Name
Members
- Id
- GroupId
- Name
I want to display a list of Groups with their member count. I can get all the groups and then use a foreach statement to count the number of members. But this is very inefficient.
Is there a way to write a LINQ query that will return the member count in a single query?