title: Lambda expression Where on navigation property
body: <p>Good afternoon,</p>
  
  <p>I have three entities (that concern this question)</p>
  
  <p>Company (ID, etc..)
  CompanyAddress (AddressID, CompanyID, Rank)
  AddressDetails (AddressID, Street, City, State, Zip)</p>
  
  <p>The reason Rank and company id aren't in the AddressDetails is because the address details are shared with contacts via a ContactAddress entity.</p>
  
  <p>Anyway, I need to build an IQueryable given an IQueryable that will check if a string is contained in the City (and eventually or state).  I'd like to use Lambda expressions not the <code>from c in companies</code> syntax...I tried </p>
  
  <pre><code>query = query.Select(c =&gt; c.Addresses.Where(a =&gt; a.AddressDetails.City.Contains(City)).Select(ca =&gt; ca.Company));
  </code></pre>
  
  <p>In this example c.Addresses is the navigation property for CompanyAddress.</p>
  
  <p>Thanks for any help,</p>
  
  <p>Paul</p>