title: WebAPI CRUD in relationship table with Entity Code First
body: <p>I have two entities Student and Class. I've created the DB with Code First Entity Framework, and i want it to create a many-to-many relationship table.</p>
  
  <pre><code>public class Student
  {
      [Key]
      public int      Id     { get; set; }
      public string   Name       { get; set; }
  
      public ICollection&lt;Class&gt; Classes { get; set; }
  }
  
  public class Class
  {
      [Key]
      public int      Id   { get; set; }
      public string   Name   { get; set; }
  
      public ICollection&lt;Student&gt; Students { get; set; }
  }
  </code></pre>
  
  <p>This created the three tables in the DB: Students, Classes and StudentsClasses (with StudentId and ClassId).</p>
  
  <p>Now i've scaffolded the web api controllers and it created StudentController and ClassController. I now can make CRUD to the Student and Class entity separately but how can i make CRUD to the relationship table (StudentsClasses) ? Another controller for that table ? Or multiple POST parameters ? </p>
  
  <p>My real problem is that I want in my client to POST a Class, then POST a Student and finally POST a Student to a Class (should be in relation table StudentsClasses).</p>