title: Linq and conditional sum
body: <p>I have a class and a list as below:</p>
  
  <pre><code>class C1
  {
      int RecType ...;
      decimal Income ...;
      decimal Outcome ...;
  }
  
  List&lt;C1&gt; myList ...;
  </code></pre>
  
  <p>The list is loaded with several records, and they have various values in RecType
  What I want is to calculate total on Income and Outcome but only for a certain value of RecType</p>
  
  <p>Here's a pseudo code of what I need to get</p>
  
  <pre><code>totalIncome = myList.Sum(Income).Where(RecType==1);
  </code></pre>
  
  <p>How can I accomplish this with linq?</p>
  
  <p>Thank you</p>