title: How to setup custom join table in Entity Framework
body: <p>When setting up a many-to-many relationship with Code First approach, by default the join table only includes 2 columns (FK to PK of the 2 tables).</p>
  
  <p>1) Is it possible/How can I setup a join table that will include some additional fields, and 2) how do I fill these values via code?</p>
  
  <p>For example:</p>
  
  <pre><code>class Student
  {
      public int Id { get; set; }
      public string Name { get; set; }
      public List&lt;Course&gt; Courses { get; set; }
  }
  
  class Course
  {
      public int Id { get; set; }
      public string Name { get; set; }
      public List&lt;Student&gt; Students { get; set; }
  }
  
  class MyDbContext : DbContext
  {
      public DbSet&lt;Student&gt; Students { get; set; }
      public DbSet&lt;Course&gt; Courses { get; set; }
  }
  </code></pre>
  
  <p>A simple db with Students and Courses with a many-to-many relationship. However for each join Student-Course, I also want a field, for example: PercentComplete, that tracks how far a student is in each course.</p>
  
  <p>How can this be achieved?</p>
  
  <p>Thanks</p>