Below is my linq query :
var objList = from p in db.Table1
join q in db.Table2 on p.saleCategoryId equals q.Id
join r in db.Table3 on p.landDetailId equals r.Id
select new
{
p.Id,
r.KhataNo,
r.KhasraNo,
q.type,
p.saleCategoryId,
p.area,
p.stock
};
From above query I have a result like below :
Id KhataNo KhasraNo Type SaleCategoryId Area Stock
1 1AB 11AB LOM 1 100 50
2 1AB 11AB LOR 2 200 100
3 1CD 11CD LOM 1 300 150
4 1CD 11CD LOR 2 250 50
But I want to group by and summing up few columns above in following way (desired output) :
Id KhataNo KhasraNo Area Stock
1 1AB 11AB 300 150
2 1CD 11CD 550 200
Anyone can help me please to get the desired output.