<p>What is the difference between <code>IQueryable&lt;T&gt;</code> and <code>IEnumerable&lt;T&gt;</code>?</p>

<hr>

<p>See also <a href="https://stackoverflow.com/questions/2433306/whats-the-difference-between-iqueryable-and-ienumerable?rq=1">What's the difference between IQueryable and IEnumerable</a> that overlaps with this question.</p>

The primary difference is that the LINQ operators for
```
IQueryable<T>
```
take
```
Expression
```
objects instead of delegates, meaning the custom query logic it receives, e.g., a predicate or value selector, is in the form of an expression tree instead of a delegate to a method.
```
IEnumerable<T>
```
is great for working with sequences that are iterated in-memory, but
```
IQueryable<T>
```
allows for out-of memory things like a remote data source, such as a database or web service.
Query execution:
Where the execution of a query is going to be performed
"in process"
, typically all that's required is the code (as code) to execute each part of the query.
Where the execution will be performed
out-of-process
, the logic of the query has to be represented in data such that the LINQ provider can convert it into the appropriate form for the out-of-memory execution - whether that's an LDAP query, SQL or whatever.
More in:
LINQ :
```
IEnumerable<T>
```
and
```
IQueryable<T>
```
C# 3.0 and LINQ
.
"
Returning
```
IEnumerable<T>
```
vs
```
IQueryable<T>
```
"
Reactive Programming for .NET and C# Developers - An Introduction To
```
IEnumerable
```
,
```
IQueryable
```
,
```
IObservable
```
, and
```
IQbservable
```
2008: "
THE MOST FUNNY INTERFACE OF THE YEAR …
```
IQUERYABLE<T>
```
" from
Bart De Smet
.