Group Multiple Tables in LINQ
this might help:
(
from r in db.Rider
join s in db.Spaces
on r.SpaceID equals s.SpaceID
group new { r,s } by new { r.SpaceID, s.SpaceCode }
into grp
select new
{
Count=grp.Count(),
grp.Key.SpaceID,
grp.Key.SpaceCode
}
)
Where db is the database context
For grouping multiple tables you can do as:
group new { r,s } by new { r.SpaceID, s.SpaceCode }