IEnumerable is the base interface for all non generic collections that can be enumerated by implemented interface System.Collections.Generic.IEnumerable<T>. IEnumerable contains a single method called GetEnumerator() which returns an IEnumerator and also provides the ability to iterate through the collection by exposing a Current property and MoveNext and Reset methods. IEnumerable functionality using the foreach syntax however implementing IEnumerable is not required. When using Visual Basic you must provide an IEnumerator implementation which is returned by GetEnumerator. When developing with C# you must provide a class that contains a Current property, and MoveNext and Reset methods as described by IEnumerator, but the class does not have to implement IEnumerator.
C# Corner. All contents are copyright of their authors.