Since you're not trying to extract any values from the Book
part of the join you don't need DefaultIfEmpty()
, and since the join is a "group join" as a result of the into
clause you don't need to group again:
from a in Store
join b in Book on a.id equals b.id into c
select new
{
StoreId = a.id,
StoreType = a.type,
TotalCount = C.Count()
}