If i understand you well, you don't know how the get sum of
Qnty
field in
stock
table...
This is the way:
var result = dbcontext.stock
.GroupBy(x=>x.itemID)
.Select(grp=>new
{
itemID = grp.Key,
Count = grp.Sum(x=>x.Qnty)
})
.ToList();
The rest of job belongs to you!