I have the following for each loop to get sum of all child objects. Is there a better way using LINQ?
Purchase p1 = db.Purchases.FirstOrDefault(p => p.PurchaseId == 1);
int total = 0;
foreach (SellingItem item in p1.SellingItems)
{
total = total + Convert.ToInt32(item.Price);
}

REFERENCE:
Sounds like you just want:
Why do you need the conversion of the price though? What type is
Price, and why isn’t it already the right type? (And does that really want to beintrather thandecimal?)