有几条数据是这样的
Person 123 456 789
Person 321 654 987
想合并成
Person 444 1110 1776
直接一条linq搞定
var newQuery = from p in query group p by p.Name into g select new { Name = g.Name, Value = g.Sum(x => x.Value) };
有几条数据是这样的
Person 123 456 789
Person 321 654 987
想合并成
Person 444 1110 1776
直接一条linq搞定
var newQuery = from p in query group p by p.Name into g select new { Name = g.Name, Value = g.Sum(x => x.Value) };