Thursday, August 27, 2020

What is IEnumerable in C#?

 IEnumerable in C# is an interface that defines one method, GetEnumerator which returns an IEnumerator interface. This allows read-only access to a collection then a collection that implements IEnumerable can be used with a for-each statement.