kuhaku kuhaku - 11 months ago 56
C# Question

Where is the implementation of IEnumerable of Collection<T>

Suppose I have a

and I'm using
that returns
, where can I find the implementation of
for this collection?

On MS site they just say:

Returns an enumerator that iterates through the Collection.

But where is the class that implements

Answer Source

Looking into the source we can see that GetEnumerator returns the GetEnumerator of its' items field which concrete type is List<T> (inside the ctor)

That GetEnumerator returns an instance of List<T>.Enumerator an internal nested class whose source is available here