标签:
var result = fruit.GroupBy(i => i.date)
.Select(i => new
{
date = i.Key,
no_of_apple = i.Where(j => j.fruit_code == "apple").Sum(k => k.count),
no_of_pear = i.Where(j => j.fruit_code == "pear").Sum(k => k.count)
});标签:
原文地址:http://www.cnblogs.com/shiningrise/p/5657067.html