title: .SELECT statement using lambda and Entity Framework
body: <p>I am struggling here in using <em><code>.SELECT</code></em> statement. </p>
  
  <p>Here a snippet of my code;</p>
  
  <pre><code>var payoutsPerLocation = locations.Select(l =&gt; l.Payouts);
  
  foreach (var payouts in payoutsPerLocation)
  {
      Console.WriteLine(payouts.Sum(pos=&gt;pos.Amount));
  }
  </code></pre>
  
  <p>Where in location is a list, and one location has one or more payout. I want to get all the payouts.</p>
  
  <p>The above code's result is below</p>
  
  <pre><code>0
  0
  0
  0
  0
  0
  </code></pre>
  
  <p>It should be the sum of the amount of payouts per location. It seems like I don't get any records of payout. But when I tried using the code below (for testing if I am getting payout);</p>
  
  <pre><code>var payoutsPerLocation = locations.FirstOrDefault().Payouts;
  
  foreach (var payout in payoutsPerLocation)
  {
      Console.WriteLine(payout.Amout);
  }
  </code></pre>
  
  <p>There is a payout for that location. What do you guys think I am doing wrong here?</p>
  
  <p>Any help is appreciated. </p>