3 ms·
[...] although they use the slightly older IEnumerator instead of IEnumerable ¹). They are not older or newer, they belong together. IEnumerable has only one m
by danbruc 4y ago
[...] although they use the slightly older IEnumerator instead of IEnumerable ¹).
They are not older or newer, they belong together. IEnumerable has only one method GetEnumerator() which returns an IEnumerator. If you have an IEnumerator, you can iterate over the sequence once [at a time], if you have an IEnumerable you can obtain as many IEnumerator as you need or want.