分组求和(linq的distinct不好用,类似的还可以使用分组进行获取唯一值)

var vMergeFilter = from a in lstFilter
    group a by a.ItemCode into b
    select new { b.Key, SumQty = b.Sum(l => l.Qty), SumSaleTotal = b.Sum(l => l.SaleTotal) };

 

posted @ 2016-01-20 17:38  xfyn  阅读(178)  评论(0编辑  收藏  举报