title: Combining Entity Framework SqlQuery with extra restriction in code
body: <p>I have a SQL query</p>
  
  <pre><code>var sql = "Select * From Foo Where Bar = {0}"
  </code></pre>
  
  <p>I want to execute this using Entity Framework, but I want to impose an extra restriction, to see if column Id is in a certain range:</p>
  
  <pre><code>List&lt;int&gt; ids = ...;
  var MyFoos = context.Foos.SqlQuery&lt;Foo&gt;(sql).Where(x =&gt; ids.Contains(x.Id));
  </code></pre>
  
  <p>Is this likely to result in efficient selection from the database, or would it end up executing the whole of "Select * From Foo Where Bar = {0}" first and only then filtering for the IDs?</p>