Group By and Sum using Linq On Entity

Ashif Avatar

It requires to get group by with sum.

var amount = plod.objProduct.Where(i => i.SID == nslres.SID).GroupBy(s => s.SID).Select(x => new { Totamt = x.Sum(y => y.PrdPrice) }).FirstOrDefault().Totamt;

 

Leave a Reply

Your email address will not be published. Required fields are marked *