As you use iterator functions (and
yield) more and more, you’ll start to run into some limitations in the C# language. For instance, you can’t
yield inside a
try block that has a
catch block. And the
foreach loop doesn’t provide a very good way to catch exceptions when looping over an iterator function, either. Today’s article goes into detail to find solutions to these issues and make iterator functions usable in even the trickiest scenarios!
Read the rest of this article »