title: Fastest way Calculating Sum of Customers' Orders using Linq
body: <p>In my Database I have many customers and I submit each customer's orders.
  Now I need to loop through all customers and find the customers who have order more than a target price. i'm using this piece of code:</p>
  
  <pre><code>List&lt;int&gt; IDz = new List&lt;int&gt;();
  foreach (var customer in db.tblCustomers)
  {
      total = 0;
      foreach (var order in db.tblCustomerOrders.Where(x =&gt; x.CustomerID == customer.CustomerID))
          total += Convert.ToDouble(order.Amount);
  
       if (total &gt;= Convert.ToDouble(txtAmount.Text))
           IDz.Add(customer.CustomerID);
  }
  </code></pre>
  
  <p>This code will take about more than 15 seconds for about 1500 customers. How Can I make is faster? any suggestion?</p>