title: Entity Framework not sending Where clauses as WHERE clauses to SQL Server
body: <p>I have a simple DB that has Sites, and each Site has a bunch of Posts.</p>
  
  <p>I'm trying to get all the "Public" Posts of a certain Site (I have a variable called site that is already an instance brought by EF)</p>
  
  <p>The first obvious thing is:</p>
  
  <pre><code>  var posts = from post in site.Posts
                where post.Public == true
                orderby post.PublicationTime descending
                select post;
  </code></pre>
  
  <p>This brings me what I want, but looking into SQL Server Profiler, the WHERE only is filtering the Public field, not the Site. In fact, running in SQL Server the query that Profiler captures indeed brings back all the posts from all the sites (and this is obviously being filtered in the ASP.Net side later).</p>
  
  <p>Then I tried:</p>
  
  <pre><code>  var posts = from post in db.Posts
                where post.Site == site &amp;&amp; post.Public == true
                orderby post.PublicationTime descending
                select post;
  </code></pre>
  
  <p>Same result.</p>
  
  <p>Am I doing something fundamentally stupid here?<br>
  Does Entity Framework ALWAYS filter in the client-side?</p>
  
  <p>Thanks!<br>
  Daniel</p>