IEnumeration
does not have a method called Count()
. It's just a kind of "sequence of elements". Use for example List
if you explicitly need the number of elements.
If you use Linq keep in mind, that the extension method Count()
may actually re-count the number of elements each time you call it.