
Writing
So You Think You Know C#? For vs. Foreach
The type a foreach loop sees determines its enumeration path. Array lowering, list enumerators and yield state machines explain the work behind the syntax.

Topic
Traversing a sequence one item at a time through a stable iteration contract, with the consumer requesting each next item.
2 pages

Writing
The type a foreach loop sees determines its enumeration path. Array lowering, list enumerators and yield state machines explain the work behind the syntax.

Writing
Async streams let callers process database rows before the full result exists. An async iterator combines await and yield return, keeping its reader open during enumeration.