C#linq 1

 List nn = yzList.GroupBy(d => new { d.SFXMMC, d.GG, d.YPID })
                        .Select(s => new WFYDLModel { YPID = s.Key.YPID, SFXMMC = s.Key.SFXMMC, SL = s.Sum(x => Convert.ToDecimal(x.SL)).ToString() }).ToList();
                        

 

你可能感兴趣的:(C#linq 1)