// globalAmount je celkov hodnota vech objednvek
var limitAmount = globalAmount * 0.8m;
var aggregated = 0m;
var topCustomers =
  (from c in customers
   join o in (
      from c in customers
         from o in c.Orders
         join p in products
              on o.IdProduct equals p.IdProduct
         select new { c.Name, OrderAmount = o.Quantity * p.Price }
      ) on c.Name equals o.Name
      into customersWithOrders
   let TotalAmount = customersWithOrders.Sum(o => o.OrderAmount)
   orderby TotalAmount descending
   select new { c.Name, TotalAmount }
  )
  .TakeWhile( X => {
                               bool result = aggregated < limitAmount;
                               aggregated += X.TotalAmount;
                               return result;
                         } );
