Almog Cohen Yes, that is true but only if you don’t apply any operator that converts it to an IEnumerable. If you apply a Where(), the resulting number of elements may change, forcing a full scan to count the elements. I wrote a follow-up explaining why you should not trust that optimization. If you want to use the Count property, use IReadOnlyCollection or ICollection explicitly.

Principal Engineer @ Farfetch - Future Retail Lab https://about.me/antao.almada

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store