Q:

why is it trying to convert? c#

i have two 'foreach' loops that are throwing errors telling me that i cannot convert Student.FoodItem to a double. I'm stumped as to what I have done wrong, here are the loops.
 foreach (double cost in Order.OrderedFood)
        {
            totalFood += Food.Cost;
        }

 foreach (double cost in Order.OrderedDrink)
        {
            totalDrink += Drink.Cost;
        }

 double totalFood = 0.0;
 double totalDrink = 0.0;

A:

This could be done more elegantly using LINQ:
totalFood = Order.OrderedFood.Sum(x => x.Cost);
totalDrink = Order.OrderedDrink.Sum(x => x.Cost);

