Top "Ienumerable" questions

IEnumerable, and its generic counterpart IEnumerable<T> are .NET interfaces for iterating (or enumerating) through a collection of items.

C#: How can I make an IEnumerable<T> thread safe?

Say I have this simple method: public IEnumerable<uint> GetNumbers() { uint n = 0; while(n < 100) yield return n++; } …

c# thread-safety ienumerable
Finding symmetric difference with LINQ

I have two collections a and b. I would like to compute the set of items in either a or …

c# linq ienumerable set-theory
Is it possible to turn an IEnumerable into an IOrderedEnumerable without using OrderBy?

Say there is an extension method to order an IQueryable based on several types of Sorting (i.e. sorting by …

c# linq ienumerable iorderedenumerable
Manually increment an enumerator inside foreach loop

I have a nested while loop inside a foreach loop where I would like to advance the enumerator indefinitately while …

c# loops foreach ienumerable ienumerator
How to find max value in a column in a datarow[] ?

I have a simple problem but I just don't understand any of the examples I find here or in MSDN. (…

c# ienumerable max datarow icomparable
Why there is two completely different version of Reverse for List and IEnumerable?

For the List object, we have a method called Reverse(). It reverse the order of the list 'in place', it …

c# linq list ienumerable reverse
Is yield return in C# thread-safe?

I have the following piece of code: private Dictionary<object, object> items = new Dictionary<object, object>; …

c# ienumerable yield yield-return
Best way to convert an IEnumerable<T> to an T[]

What is the best way to convert from a generic IEnumerable<T> implementation to an array of T? …

arrays collections .net-2.0 c#-2.0 ienumerable
How to know if Array FileInfo[] contains a file

I have the following code, I receive an error at "if statement" saying that FileInfo does not contain a definition "…

c# linq ienumerable fileinfo
List 'Except' comparison - ignore case

I have two lists and I want to compare them and get the differences, while ignoring any case differences. I …

c# list ienumerable case-sensitive