Using method syntax I can print to console all orders of $100
foreach (var order in orders.Where(o => o.Amount == 100))
Console.WriteLine("Order: {0} - Order Amount: {1}", order.OrderID, order.Amount);
But to do this using query syntax, I have to create a var first to store the results before my Console.WriteLine loop:
var summary = from o in orders
where o.Amount == 100
select o;
foreach (var order in summary)
Console.WriteLine("Order: {0} - Order Amount: {1}", order.OrderID, order.Amount);
Can this query syntax be reduced to eliminate the declaration of summary?