title: EF CTP5 - Strongly-Typed Eager Loading - How to Include Nested Navigational Properties?
body: <p>Attempting to cutover our EF4 solution to EF CTP5, and ran into a problem.</p>
  
  <p>Here's the relevant portion of the model:</p>
  
  <p><img src="https://i.stack.imgur.com/OZqCO.png" alt="enter image description here"></p>
  
  <p>The pertinent relationship:
   - A single <strong>County</strong> has <strong>many Cities</strong>
   - A single <strong>City</strong> has a <strong>single State</strong></p>
  
  <p>Now, i want to perform the following query:
   - Get all Counties in the system, and include all the Cities, and all the State's for those Cities.</p>
  
  <p>In EF4, i would do this:</p>
  
  <pre><code>var query = ctx.Counties.Include("Cities.State");
  </code></pre>
  
  <p>In EF CTP5, we have a strongly typed Include, which takes an <code>Expression&lt;Func&lt;TModel,TProperty&gt;&gt;</code>.</p>
  
  <p>I can get all the Cities for the County no problem:</p>
  
  <pre><code>var query = ctx.Counties.Include(x =&gt; x.Cities);
  </code></pre>
  
  <p>But how can i get the <em>State</em> for those Cities too?</p>
  
  <p>I am using pure POCO's, so <code>County.Cities</code> is an <code>ICollection&lt;City&gt;</code>, therefore i cannot do this:</p>
  
  <pre><code>var query = ctx.Counties.Include(x =&gt; x.Cities.State)
  </code></pre>
  
  <p>As <code>ICollection&lt;City&gt;</code> does not have a property called <code>State</code>.</p>
  
  <p>It's almost like i need to use a nested IQueryable.</p>
  
  <p>Any ideas? Do i need to fallback to the magic string Include in this scenario?</p>