任何人都可以帮我将下面的查询转换为LINQ with Lambda expression。
select idshiftschedule,Date from Teammateassignments
where IdClinic = 19
group by IdshiftSchedule,DATE having COUNT(Date)>1
答案 0 :(得分:1)
这只是后来群组的过滤器:
var results = from item in assignments
where item.IdClient == 19
group item by new { item.IdShiftSchedule, item.Date } into g
where g.Count() > 1
select g.Key;
(我假设Count(Date) > 1
实际上只是在计算组中的项目数...例如,如果Date
可以为空,我不清楚它会做什么。)