title: Design simple code first movies database (many to many) EF
body: <p>I'm doing some tutorial on ASP MVC and the guy in the video only uses 1 genre per movie, but I'm interested in knowing on how to make a movie have multiple genres. Example, how do I make this code:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class Movie
  {
      public int Id { get; set; }
      public string Name { get; set; }
      public ICollection&lt;Genre&gt; Genre { get; set; }
  }
  
  public class Genre
  {
      public int Id { get; set; }
      public string Name { get; set; }
  }
  </code></pre>
  
  <p>generate some tables like this:</p>
  
  <p><strong>Movie</strong></p>
  
  <ul>
  <li>Id (Primary Key)</li>
  <li>Name</li>
  </ul>
  
  <p><strong>Genre</strong></p>
  
  <ul>
  <li>Id (Primary Key)</li>
  <li>Name</li>
  </ul>
  
  <p><strong>MovieGenresRelation</strong></p>
  
  <ul>
  <li>Id (Primary Key)</li>
  <li>MovieId (References Movie.Id)</li>
  <li>GenreId (References Genre.Id)</li>
  </ul>
  
  <p>I tried adding the MovieGenresRelation class but then how do add reference properties to the Movie class?
  Anyway I think that's not how I should go about to do this so please point me to the right direction.</p>