O'Reilly logo

Pro LINQ: Language Integrated Query in C# 2008 by Joseph C. Rattz Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

IQueryable<T>

You will see that in many of the LINQ to SQL examples in this chapter and the subsequent LINQ to SQL chapters, I work with sequences of type IQueryable<T>, where T is the type of an entity class. These are the type of sequences that are typically returned by LINQ to SQL queries. They will often appear to work just like an IEnumerable<T> sequence, and that is no coincidence. The IQueryable<T> interface implements the IEnumerable<T> interface. Here is the definition of IQueryable<T>:

interface IQueryable<T> : IEnumerable<T>, IQueryable

Because of this inheritance, you can treat an IQueryable<T> sequence like an IEnumerable<T> sequence.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required