In this lecture you'll learn how to produce data lazily and safely in C# using generators based on
yield: what
yield return and
yield break are, how the compiler builds a state machine for
IEnumerable<T>/
IEnumerator<T>, where generators are used in practice, and how to work with asynchronous streams via
IAsyncEnumerable<T>,
await foreach,
await using,
IAsyncDisposable and
CancellationToken. Plus — limitations, pitfalls and tips for effective use.