IEnumerable<T>, Sequences, and the Standard Query Operators

IEnumerable<T>, pronounced I enumerable of T, is an interface that all of the C# 2.0 generic collection classes implement, as do arrays. This interface permits the enumeration of a collection's elements.

A sequence is a logical term for a collection implementing the IEnumerable<T> interface. If you have a variable of type IEnumerable<T>, then you might say you have a sequence of Ts. For example, if you have an IEnumerable of string, written as IEnumerable<string>, you could say you have a sequence of strings.

NOTE

Any variable declared as IEnumerable<T> for type T is considered a sequence of type T.

Most of the Standard Query Operators are extension methods in the System.Linq.Enumerable ...

Get Pro LINQ: Language Integrated Query in C# 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.