title: Returning Related Entites in EF6 with Linq
body: <p>I am having a problem understanding how Linq and EF are working to return data.   I have three simple classes</p>
  
  <p>Products,
  Materials,
  Documents</p>
  
  <p>Products are made up of materials and materials have documents.   When I load a product, I want to return all the documents for the materials that product is made up from. </p>
  
  <p>Here are my classes:</p>
  
  <pre><code>    public class Product
      {        
        public int Id { get; set; }
        public string Name { get; set; }
        ...
        public ICollection&lt;ProductMaterials&gt; ProductMaterial { get; set; }
      }
      public class ProductMaterials 
      {           
          public int Id { get; set; }
  
          public int ProductId { get; set; }
          public Product Product { get; set; }
          public int MaterialId { get; set; }
          public Materials Material { get; set; }
          ...           
      }
  
  public class Document
  {
      public int Id { get; set; }
      public string Name { get; set; }
      ...
      public ICollection&lt;MaterialDocument&gt; MaterialDocument { get; set; } 
  }
  
  public class MaterialDocument
  {
      public int Id { get; set; }
      public int MaterialId { get; set; }
      public Materials Material { get; set; }
      public int DocumentId { get; set; }
      public Document Document { get; set; }
  }
  </code></pre>
  
  <p>I am not having any issues when loading a material and its related documents.  I use this query:</p>
  
  <pre><code>var materialDocuments = db.MaterialDocuments
                                       .Include("Document")
                                       .Where(i =&gt; i.MaterialId == id)
                                       .ToList();
  </code></pre>
  
  <p>How can I load Product with related Materials and the Material's documents?   Do I need additional Navigation properties on the MaterialDocument class pointing back to ProductMaterials?</p>