title: Entity Framework Include With Where With 3 Tables
body: <p>I'm trying to include two tables off of one base table, and provide a "where" statement on the second table, but I'm getting a very confusing error (below). Any thoughts on the issue/solution?</p>
  
  <pre><code>ObjectQuery&lt;STATE&gt; productQuery = 
      LeadsContext.STATE.Include("REGION")
        .Where("it.REGION.BRAND.BRAND_ID = @brand", new ObjectParameter("brand", brand))
        .OrderBy("it.STATE_ABBV");
  </code></pre>
  
  <p>Basic table layout: STATE ------ REGION ------ BRAND</p>
  
  <p>BRAND_ID is in BRAND</p>
  
  <blockquote>
    <p>'BRAND' is not a member of 'Transient.collection[Citizens.Leads.Data.REGION(Nullable=True,DefaultValue=)]'.
    To extract properties out of collections, you must use a sub-query
    to 
        iterate over the collection., near multipart identifier, line 8, column
    1.</p>
  </blockquote>