Using the yield keyword in C#

The yield contextual keyword was first introduced in C# 2.0 and despite that fact, it is rarely used. Perhaps it is not a well-known feature or perhaps it is misunderstood but it has plenty of uses. In this post, I will demonstrate how to use the yield contextual keyword and discuss some common scenarios where it would be useful. What does …