title: Whats the difference between IQueryable and DbQuery?
body: <p>Following up on this question/answer<br>
  <a href="https://stackoverflow.com/questions/10437058/how-to-make-entity-framework-data-context-readonly">How to make Entity Framework Data Context Readonly</a></p>
  
  <p>The solution is to make your DbContext collections of the type DbQuery, but that is a rather specialized type (it's buried down in the namespaces for EF).</p>
  
  <p>So, what's the functional difference between have a DbContext with this:</p>
  
  <pre><code>public DbQuery&lt;Customer&gt; Customers
  {
      get { return Set&lt;Customer&gt;().AsNoTracking(); }
  }
  </code></pre>
  
  <p>vs this:</p>
  
  <pre><code>public IQueryable&lt;Customer&gt; Customers
  {
      get { return Set&lt;Customer&gt;().AsNoTracking(); }
  }
  </code></pre>
  
  <p>...the EF documentation is very light when it comes to the DbQuery class, but I prefer the idea of having DbContext made up of interfaces rather than classes so I'd like to avoid it. What additional benefits does the DbQuery class provide?</p>
  
  <p><strong>Update</strong></p>
  
  <p>After reading the answers and just looking at the code I realized my question was a little silly. I was too quick to ask before I thought! Obviously the underlying concrete object will be a DbQuery regardless, so the actually inner functionality will be the same. It seems to me that using IQueryable is the better choice. Thanks for your patience!</p>