title: Which method performs better: .Any() vs .Count() > 0?
body: <p>in the <code>System.Linq</code> namespace, we can now extend our <a href="https://docs.microsoft.com/en-us/dotnet/api/system.collections.ienumerable?view=netframework-3.5" rel="noreferrer">IEnumerable's</a> to have the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.any?view=netframework-3.5" rel="noreferrer">Any()</a> and <a href="https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.count?view=netframework-3.5" rel="noreferrer">Count()</a> <em>extension methods</em>.</p>
  <p>I was told recently that if i want to check that a collection contains 1 or more items inside it, I should use the <code>.Any()</code> extension method instead of the <code>.Count() &gt; 0</code> extension method because the <code>.Count()</code> extension method has to iterate through all the items.</p>
  <p>Secondly, some collections have a <em>property</em> (not an extension method) that is <code>Count</code> or <code>Length</code>. Would it be better to use those, instead of <code>.Any()</code> or <code>.Count()</code>?</p>
  <p>yea / nae?</p>