title: System.InvalidOperationException: A specified Include path is not valid
body: <p>I'm trying to get a list of projects on the index page - but I keep on getting errors. I have tried different codes, and below is the latest one I've tried - but it's still not working. It gave me this error:</p>
  
  <p>System.InvalidOperationException: A specified Include path is not valid. The EntityType 'StoreWeb.Models.Project' does not declare a navigation property with the name 'Collections'</p>
  
  <p>I think it's because I don't know how to get collectionID from the Project table. For the Project table, it has collectionID is as a foreign key. (A project must have 1 collection. A collection may have projects.)</p>
  
  <p>Can someone please help me? Here's what I have:</p>
  
  <p><strong>MODELS</strong></p>
  
  <hr>
  
  <p>Collection.cs [Modified]</p>
  
  <hr>
  
  <pre><code>[Table("Collection")]
  public class Collection
  {
      [Key]
      public string collectionID { get; set; }
      public string collectionName { get; set; }
  
      public List&lt;Project&gt; Projects { get; set; }
  }
  </code></pre>
  
  <hr>
  
  <p>Project.cs [Modified]</p>
  
  <hr>
  
  <pre><code>[Table("Project")]
  public class Project
  {
      [Key]
      public string projectID { get; set; }
      public string projectName { get; set; }
      public string projectCity { get; set; }
      public string collectionID { get; set; } // This is what was needed!
  
      public virtual Collection Collection { get; set; }
  }
  </code></pre>
  
  <p>For the class Project, it has collectionID is as a foreign key. (A project must have 1 collection. A collection may have projects.)</p>
  
  <hr>
  
  <p>ProductEntities.cs</p>
  
  <hr>
  
  <pre><code>public class ProductEntities : DbContext
  {
      public DbSet&lt;Collection&gt; Collections { get; set; }
      public DbSet&lt;Project&gt;    Projects  { get; set; }
  }
  </code></pre>
  
  <p><strong>CONTROLLER</strong></p>
  
  <hr>
  
  <p>ProjectController [Modified]</p>
  
  <hr>
  
  <pre><code>using System.Data.Entity;
  
  public class ProjectController : Controller
  {
      ProductEntities productDB = new ProductEntities();
  
      //
      // GET: /Project/
  
      public ActionResult Index()
      {
          var projectModel = productDB.Projects.Include(m =&gt; m.Collection);
          return View(projectModel);
      }
  </code></pre>
  
  <p><strong>VIEWS</strong></p>
  
  <hr>
  
  <p>Views/Project/Index.chtml</p>
  
  <hr>
  
  <pre><code>@model IEnumerable&lt;StoreWeb.Models.Project&gt;
  
  @{
       ViewBag.Title = "Index";
  }
  &lt;h1&gt;PROJECTS&lt;/h1&gt;
  
       @foreach (var project in Model)
       {
           &lt;br /&gt;&lt;a href="@Url.Action("Details", new { id = project.projectID })"&gt;@project.projectName&lt;/a&gt; 
       }
  </code></pre>