Chapter 4yield return: Using .NET’s State Machine Generator

In This Chapter

Image Understanding How yield return Works

Image Using yield return and yield break

“Always bear in mind that your own resolution to succeed is more important than any one thing.”

—Abraham Lincoln

Just a few short years ago, developers had to inherit from ReadOnlyCollectionBase or CollectionBase to implement strongly typed collections. If you wanted to define custom types, instead of using DataSets, then this was the way to go. With the introduction of generics, you no longer have ...

Get LINQ Unleashed for C# now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.