Working with lists

Understanding the power of yield return

Using the yield return for returning one item at a time

Andre Lopes
Geek Culture
Published in
4 min readAug 10, 2022
Photo by Kelly Sikkema on Unsplash

Hi, Earthlings!

Today I want to show you both ways of manipulating and returning lists from C# methods.

First I’ll demonstrate what is the “conventional” way of doing that by creating an empty list…

--

--

Andre Lopes
Geek Culture

Full-stack developer | Casual gamer | Clean Architecture passionate