33

Is yield return a shortcut for implementing IEnumerable and IEnumerator?

BartoszKP
  • 34,786
  • 15
  • 102
  • 130
John
  • 5,381
  • 4
  • 30
  • 26

3 Answers3

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
2

Yes. See the following for a starter

http://msdn.microsoft.com/en-us/library/dscyy5s0.aspx

JaredPar
  • 733,204
  • 149
  • 1,241
  • 1,454