[Solved] Stop IEnumerable from enumerating through all elements [closed]


You can use the Take method to do something like this:

profile = profile.Take(1);

Now, when you enumerate profile, you will go through one item only.

5

solved Stop IEnumerable from enumerating through all elements [closed]