Top "Ienumerable" questions

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

Does LINQ work with IEnumerable?

I have a class that implements IEnumerable, but doesn't implement IEnumerable<T>. I can't change this class, and …

.net linq ienumerable
Differences between IQueryable, List, IEnumerator?

I am wondering what the difference between IQueryable, List, IEnumerator is and when I should use each one? For instance …

c# linq list ienumerable iqueryable
Convert DataRowCollection to IEnumerable<T>

I would like to do something like this in .NET 3.5. What's the quickest way? IEnumerable<DataRow> collection = TypedDataSet.…

c# .net linq .net-3.5 ienumerable
Get previous and next item in a IEnumerable using LINQ

I have an IEnumerable of a custom type. (That I've gotten from a SelectMany) I also have an item (myItem) …

c# linq ienumerable
Why doesn't Any() work on a c# null object

When calling Any() on a null object, it throws an ArgumentNullException in C#. If the object is null, there definitely …

c# .net object ienumerable
Code for adding to IEnumerable

I have an enumerator like this IEnumerable<System.Windows.Documents.FixedPage> page; How can I add a page (…

c# ienumerable add
Why use .AsEnumerable() rather than casting to IEnumerable<T>?

One of the extension methods on IEnumerable<T> is .AsEnumerable(). This method converts the enumerable object it was …

c# linq ienumerable
Should I always return IEnumerable<T> instead of IList<T>?

When I'm writing my DAL or other code that returns a set of items, should I always make my return …

c# ienumerable
Map two lists into a dictionary in C#

Given two IEnumerables of the same size, how can I convert it to a Dictionary using Linq? IEnumerable<string&…

c# .net linq dictionary ienumerable
Creating the IEnumerable<KeyValuePair<string, string>> Objects with C#?

For testing purposes, I need to create an IEnumerable<KeyValuePair<string, string>> object with the following …

c# .net ienumerable keyvaluepair