title: How to query by where clause with EF code first
body: <pre><code>class User {
      public int Id {set;get;}
      public int ExternalId {set;get;}
  }
  </code></pre>
  
  <p>I have this class defined. I am using code first EF.</p>
  
  <pre><code>public class FooContext : DbContext {
      public DbSet&lt;User&gt; Users { set; get; }
  }
  </code></pre>
  
  <p>So when I do the following:</p>
  
  <pre><code>db.Users.ToList().where(x=&gt;x.ExternalId == externalId);
  </code></pre>
  
  <p>I am curious if this does the following:</p>
  
  <pre><code>select whatever from Users where ExternalId = 'id I passed in';
  </code></pre>
  
  <p>or it loads all the users to the memory and do the Linq in memory?</p>
  
  <p>What's the best practice to query a table with a condition (where clause)?</p>