iterator
A method that hands back items one at a time, pausing between them.
An iterator is a method using yield return whose body the compiler turns into an enumerator that resumes where it left off on each MoveNext call.
Loading interactive…
Examples
static IEnumerable<int> Evens() { for (int i = 0; ; i += 2) yield return i; }hands out even numbers one at a time, for as long as you ask.
See also