var items = _voteRecordRepository.GetAll()
.Where(x => programIds.Contains(x.ProgrammeId))
.GroupBy(x=>new {x.ClientType,x.ProgrammeId})
.Select((group)=>new ProgramVoteRecordSelectItem()
{
ProgramId = group.Key.ProgrammeId,
GetVote=group.Count(),
ClientType=group.Key.ClientType
})
.ToList();
IGrouping<TKey, TElement>资料
https://msdn.microsoft.com/zh-cn/library/windows/apps/bb343251(v=vs.95).aspx
网友评论