Is yield return
a shortcut for implementing IEnumerable
and IEnumerator
?
Asked
Active
Viewed 7,967 times
33
3 Answers
32
Yes, it is.
You can find out a lot more about it in chapter 6 of my book, C# in Depth. Fortunately chapter 6 is available for free from Manning's web site.
I also have two other articles on the book's web site.
Feedback welcome.

Jon Skeet
- 1,421,763
- 867
- 9,128
- 9,194
-
1Great book! I'm actually on chapter 6, wasn't expecting an answer from the author!!! ;) – John Nov 14 '08 at 00:09
-
3The chapter link redirects to the site's root, you can go straight to the C# in Depth page here: http://www.manning.com/skeet/ – aboy021 Nov 28 '11 at 19:45
-
The articles have a lot of details. Thanks for pointing them. – marciowb Jun 01 '16 at 16:51
3
To add to the link-fest, Raymond Chen did a nice little series on C# iterators a few months ago:

Michael Burr
- 333,147
- 50
- 533
- 760