Tuesday, October 15, 2024 01:02

Archive for February, 2021

Yield return statement

Monday, February 22nd, 2021

In the previous lesson, I have talked about IEnumerable and IEnumerator, and how they help us when we need to iterate over collections of data. Let’s take an example that deals with those concepts:


C# IEnumerable

We have a function, GenerateRandomNumbers(), inside which we declare a List of ints, generate a number of random ints, equal to the _count parameter, add those random ints to the list, then return the list.… Read more


Follow the white rabbit