Can anyone explain IEnumerable and IEnumerator to me? [closed]
for example, when to use it over foreach? You don’t use IEnumerable “over” foreach. Implementing IEnumerable makes using foreach possible. When you write code like: it’s functionally equivalent to writing: By “functionally equivalent,” I mean that’s actually what the compiler turns the code into. You can’t use foreach on baz in this example unless baz … Read more