var expr =
  from p in products
  join o in (
      from c in customers
          from o in c.Orders
          join p in products
              on o.IdProduct equals p.IdProduct
          select new { p.IdProduct, OrderAmount = o.Quantity * p.Price }
      ) on p.IdProduct equals o.IdProduct
      into orders
  select new { p.IdProduct,
              TotalOrderedAmount =
                orders
                .Aggregate(0m, (a, o) => a += o.OrderAmount)};
