Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The primary difference is that the LINQ operators for <code>IQueryable&lt;T&gt;</code> take <code>Expression</code> 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. </p> <ul> <li><code>IEnumerable&lt;T&gt;</code> is great for working with sequences that are iterated in-memory, but </li> <li><code>IQueryable&lt;T&gt;</code> allows for out-of memory things like a remote data source, such as a database or web service.</li> </ul> <h3>Query execution:</h3> <ul> <li><p>Where the execution of a query is going to be performed <strong>"in process"</strong>, typically all that's required is the code (as code) to execute each part of the query. </p></li> <li><p>Where the execution will be performed <strong>out-of-process</strong>, 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.</p></li> </ul> <p>More in:</p> <ul> <li><a href="http://blogs.msdn.com/b/wriju/archive/2008/05/06/linq-ienumerable-t-and-iqueryable-t.aspx" rel="noreferrer">LINQ : <code>IEnumerable&lt;T&gt;</code> and <code>IQueryable&lt;T&gt;</code></a></li> <li><a href="http://odetocode.com/Articles/738.aspx" rel="noreferrer">C# 3.0 and LINQ</a>.</li> <li>"<a href="https://stackoverflow.com/a/2876655/6309">Returning <code>IEnumerable&lt;T&gt;</code> vs <code>IQueryable&lt;T&gt;</code></a>"</li> <li><a href="http://www.codeproject.com/Articles/646361/Reactive-Programming-For-NET-And-Csharp-Developers" rel="noreferrer">Reactive Programming for .NET and C# Developers - An Introduction To <code>IEnumerable</code>, <code>IQueryable</code>, <code>IObservable</code>, and <code>IQbservable</code></a></li> </ul> <p><img src="https://i.stack.imgur.com/2DAqv.jpg" alt="http://www.codeproject.com/KB/cs/646361/WhatHowWhere.jpg"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload