Yield return
I saw this code and got a little confused:
What is the reasoning behind yield return in this case? Im thinking a normal return would break the foreach and that there are no need for using yield.
When googling i found that the yield can be useful to reduce code(look at attached image for example) but i cant see how it is contributing to that in the case mentined above.
Thanks in advance
What is the reasoning behind yield return in this case? Im thinking a normal return would break the foreach and that there are no need for using yield.
When googling i found that the yield can be useful to reduce code(look at attached image for example) but i cant see how it is contributing to that in the case mentined above.
Thanks in advance
