title: Using SqlQuery to get IQueryable
body: <p>Is there something that can return <code>IQueryable</code>for a dynamic sql query in Entity Framework 6?</p>
  
  <p>This is what I am using now but it is pulling all the records (as expected). </p>
  
  <pre><code>DbContext.Database.SqlQuery&lt;T&gt;("SELECT * FROM dbo.SomeDynamicView")
  </code></pre>
  
  <p>Problem is that <code>SqlQuery</code> returns <a href="http://msdn.microsoft.com/en-us/library/system.data.entity.infrastructure.dbrawsqlquery(v=vs.113).aspx"><code>DbRawSqlQuery</code></a> which is <code>IEnumerable</code>.</p>
  
  <p><code>dbo.SomeDynamicView</code> is a database view created at runtime.</p>