Is Yield Return == IEnumerable & IEnumerator?

后端 未结 3 1405
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-31 09:06

Is yield return a shortcut for implementing IEnumerable and IEnumerator?

3条回答
  •  甜味超标
    2021-01-31 09:17

    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.

提交回复
热议问题