They're implemented on different types though, so they are different members. The
List<T>.Count
property is implemented specifically for that type. It will be getting a value stored within the object and not actually have to count the items each time you get it. The
Enumerable.Count
method can be called on any
IEnumerable<T>
so it may have to count the items by enumerating the object. As
@JohnH said, the property gets an existing state value while the method does work to determine the result. In a case like this, you should use the type-specific member preferentially because it is almost certainly guaranteed to be more efficient. That said, I would not be surprised to learn that
Enumerable.Count
checks whether the object is an
ICollection<T>
first and, if it is, uses it's
Count
property.