title: Why need use OnModelCreating (MVC 5 EF code first)?
body: <p>I don't understand what is the reason of using <code>OnModelCreating</code> function?</p>
  
  <p>when I can do something like  </p>
  
  <pre><code>[Key]
  [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
  public Int Id { get; set; }
  
  public Int LanguageId { get; set; }
  [ForeignKey("LanguageId")]
  
  public Language Language { get; set; }
  </code></pre>
  
  <p>Maybe I am wrong but when I reads about this,it is explained as it's for Many-to-Many relationship.
  so why not do something like this.</p>
  
  <pre><code>ICollection&lt;User&gt; Users
  </code></pre>