title: Loading nested relationships using Entity Framework
body: <p>I'm looking for a way to Load nested relationships with a where clause. </p>
  
  <p>Imagine that query example below. </p>
  
  <pre><code>select * 
  from directors d
  inner join managers m 
    on d.id = m.director
  inner join employees e
    on m.id = e.manager
  where e.name = 'John'
  </code></pre>
  
  <p>It's easy to load all the information from those entities by doing this:</p>
  
  <pre><code>ctx.Directors.Include(x =&gt; x.Managers.Select(y =&gt; y.Employees)).ToList();
  </code></pre>
  
  <p>but how can I simulate my where clause at the query posted above?</p>
  
  <p>Knowing that I'm using Entity Framework 6, is it possible to do that? I have researched for this and didn't find an answer to my question. </p>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>I'm asking this, because I'm trying to use this in a WCF Restful aplication. And it's returning with a StackOverflowException, probably because of a circular reference when I build the backward reference for the entities. </p>