Как написать ниже запрос в LINQ
select zProcessStatus.StatusName, zProcessStatus.StatusNameDari, COUNT( ProcessProgress.SchoolID) as 'Count' from zProcessStatus left join ProcessProgress on ProcessProgress.ProcessStatusID=zProcessStatus.ProcessStatusID join SubProcessStatus on zProcessStatus.ProcessStatusID=SubProcessStatus.ProcessStatusID where SubProcessStatus.SubProcessID='18250478-7DA5-45D6-90A7-51DFE94B09C8' group by zProcessStatus.StatusName ,zProcessStatus.StatusNameDari
Что я уже пробовал:
(from zProcessStatus in _applicationContext.ZProcessStatus join processProgress in _applicationContext.ProcessProgress on zProcessStatus.ProcessStatusId equals processProgress.ProcessStatusId into processprogressGroup from a in processprogressGroup.DefaultIfEmpty() join subProcessStatus in _applicationContext.SubProcessStatus on zProcessStatus.ProcessStatusId equals subProcessStatus.ProcessStatusId where subProcessStatus.SubProcessId == subprocessid select new { SchoolId = a.SchoolId.ToString(), StatusNameDari = zProcessStatus.StatusNameDari, StatusName = zProcessStatus.StatusName, }).ToList().GroupBy(x => new { x.StatusNameDari, x.StatusName }).Select( g => new { g.Key.StatusNameDari, g.Key.StatusName, Count = g.Count() }).ToList();