title: count objects that meet certain condition in List-collection
body: <p>I want to count the occurences of objects within a <code>List&lt;T&gt;</code> that match a certain condition.<br>
  For example like this<br>
  <code>int List&lt;T&gt;.Count(Predicate&lt;T&gt; match)</code><br>
  So for example if have a list of <code>chores</code>, I can see how many are overdue.  </p>
  
  <pre><code>int overdue = listOfChores.Count((element) =&gt; { return element.DueDate &lt;= DateTime.Today; });  
  </code></pre>
  
  <p>I know that does not exist and so far I solve problems like that in the following way:  </p>
  
  <pre><code>int overdue = listOfChores.FindAll([...]).Count;
  </code></pre>
  
  <p>However that allocates and initializes a new List etc. only to get the count.  </p>
  
  <p>A way to do this with less allocation overhead etc.:</p>
  
  <pre><code>int good = 0;
  foreach(chore element in listOfChores)
      if(element.DueDate &lt;= DateTime.Today)
          good++;
  </code></pre>
  
  <p>The last approach can also be exandend to count several conditions without iterating over the loop more than once. (I already found that <a href="https://stackoverflow.com/questions/24517351/does-list-count-physically-iterate-through-the-list-to-count-it-or-does-it-keep"><em>getting</em> the count property only takes O(1)</a>, but making the List to count from still eats a lot of time)</p>
  
  <pre><code>int a = 0;
  int b = 0;
  foreach(chore element in listOfChores)
      if(element.CondA)
          a++;
      if(element.CondB)
          b++;
  </code></pre>
  
  <p>Given this I could even imagine something like<br>
  <code>int[] List&lt;T&gt;.Count(Predicate&lt;T&gt;[] matches)</code>  </p>
  
  <p>My question(s):<br>
  Is there such a thing, just I haven't found it yet?<br>
  If not: What would be  way to implement such functionality?</p>
  
  <p><strong>EDIT :</strong><br>
  Adding LINQ looks like it fixes it.</p>