Enumerations in C# with IEnumerable & IEnumerator — explained
3 min readMar 30, 2021
C#, just like a lot of modern programming languages, makes it very easy to iterate collections. But how exactly do these parts work under the hood?
First, let’s see a short example:
public static void Main()
{
var simpleList = new List<String>(){ "Hello", "to", "Medium" }; foreach (var item in…