var productsQuery =
  (from p in products
  where p.Price >= 30
  select p)
  .ToList();

var ordersWithProducts =
  from c in customers
    from o in c.Orders
    join p in productsQuery
         on o.IdProduct equals p.IdProduct
    select new { p.IdProduct, o.Quantity, p.Price,
             TotalAmount = o.Quantity * p.Price};

foreach (var order in ordersWithProducts) {
  Console.WriteLine(order);
}
