title: Using Entity Framework with code-first no autoincrement
body: <pre><code>public class Movie
  {
      public int Id { get; set; }
  
      [Required]
      [StringLength(255)]
      public string Name { get; set; }
  
      public virtual IList&lt;Genre&gt; Genre { get; set; }
      public virtual IList&lt;Cast&gt; cast { get; set; }
  
      [Display(Name = "Release Date")]
      public DateTime ReleaseDate { get; set; }
  }
  
  public class Genre
  {
      public int Id { get; set; }
  
      [Required]
      [StringLength(255)]
      public String Name { get; set; }
  }
  </code></pre>
  
  <p>These are 2 of my models. They work perfectly well, except auto increment isn't implemented on the primary key.</p>
  
  <p>I'm getting error of the id being null and not be able to insert into the database which seems logic to me. Any ideas why there aren't any auto increments and secondly how can I add them? I'm using code-first migration in .NET Framework 4.6, it's a Winforms application.</p>