I am trying to summarize a column and get member wise details
My table data
id membername cost 1 a 100 2 aa 100 3 a 100 4 aa 0 5 b 100
In the Entity Framework, I am trying to summarize the cost column and get the result as follows
membername totalcost a 200 aa 100 b 100
then i do it
var result = from o in db.pruchasemasters.Where(d => d.memberid == d.membertable.id && d.entrydate >= thisMonthStart && d.entrydate <= thisMonthEnd) group o by new { o.membertable.members } into purchasegroup select new { membername = purchasegroup.Key, total = purchasegroup.Sum(s => s.price) };
How can I read the results and is this code correct?
source share