我无法确定以下LINQ查询中'Where'子句的位置:
Dim counts = eDTKBase.AsEnumerable(). _
GroupBy(Function(r) r.eDTK_PLI.). _
Select(Function(g) New With { _
.PLI_Code = g.Key, _
.CountPDP = g.Select(Function(r) r.eDTK_PDP_Code.). _
Distinct(). _
Count() _
我希望where子句过滤count为> 1的记录。有人可以帮忙吗?感谢。
答案 0 :(得分:2)
Dim counts = eDTKBase.AsEnumerable(). _
GroupBy(Function(r) r.eDTK_PLI.). _
Select(Function(g) New With { _
.PLI_Code = g.Key, _
.CountPDP = g.Select(Function(r) r.eDTK_PDP_Code.). _
Distinct(). _
Count() ...
}).Where(Function(w) w.CountPDP > 1)
获取评论中要求的总计数
Dim counts = eDTKBase.AsEnumerable(). _
GroupBy(Function(r) r.eDTK_PLI.). _
Select(Function(g) New With { _
.PLI_Code = g.Key, _
.CountPDP = g.Select(Function(r) r.eDTK_PDP_Code.). _
Distinct(). _
Count() ...
}).Where(Function(w) w.CountPDP > 1).Sum(Function(s) s.CountPDP)