Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First of all, <a href="http://msdn.microsoft.com/en-us/library/bb351562.aspx" rel="noreferrer" title="MSDN reference"><code>IQueryable&lt;T&gt;</code></a> <em>extends</em> the <code>IEnumerable&lt;T&gt;</code> interface, so anything you can do with a "plain" <code>IEnumerable&lt;T&gt;</code>, you can also do with an <code>IQueryable&lt;T&gt;</code>. </p> <p><code>IEnumerable&lt;T&gt;</code> just has a <code>GetEnumerator()</code> method that returns an <code>Enumerator&lt;T&gt;</code> for which you can call its <code>MoveNext()</code> method to iterate through a sequence of <em>T</em>.</p> <p>What <code>IQueryable&lt;T&gt;</code> has that <code>IEnumerable&lt;T&gt;</code> <em>doesn't</em> are two properties in particular—one that points to a <strong>query provider</strong> (e.g., a LINQ to SQL provider) and another one pointing to a <strong>query expression</strong> representing the <code>IQueryable&lt;T&gt;</code> object as a runtime-traversable abstract syntax tree that can be understood by the given query provider (for the most part, you can't give a LINQ to SQL expression to a LINQ to Entities provider without an exception being thrown).</p> <p>The expression can simply be a constant expression of the object itself or a more complex tree of a composed set of query operators and operands. The query provider's <code>IQueryProvider.Execute()</code> or <code>IQueryProvider.CreateQuery()</code> methods are called with an <em>Expression</em> passed to it, and then either a query result or another <code>IQueryable</code> is returned, respectively.</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