title: Comparing performance of generated queries for Any() vs Count() in Entity Framework 4.1
body: <p>I am working with Entity Framework 4.1 and C#.</p>
  
  <p>Which one is the most suitable for best performance?</p>
  
  <p>If so - why? (any links for additional readings) ?</p>
  
  <pre><code>bool isBoarding = invoice.Allocations.Where(a =&gt; a.Service.Key == "boarding").Count() &gt; 0;
  </code></pre>
  
  <p><strong>OR</strong></p>
  
  <pre><code>bool isBoarding = invoice.Allocations.Any(a =&gt; a.Service.Key == "boarding");
  </code></pre>