例如:

var sums = modellist
.GroupBy(x => x.userId)
.Select(group => new
{
Peo = group.Key,
fist = group.First()

}).ToList();

解析:

GroupBy后面用Select;

则:循环每一个分组进行select

05-21 10:03