title: EF Core The seed entity for entity type 'ClientType' cannot be added because a non-zero value is required for property 'Id'
body: <p>I am using EF Core 2.2.6 and I am trying to seed some enum values into a table. I have the following:</p>
  
  <pre><code>    var clientTypes = new List&lt;ClientType&gt;();
      foreach (var enumVal in Enum.GetValues(typeof(ClientTypeEnum)))
          clientTypes.Add(new ClientType { Id = (int)enumVal, Name = enumVal.ToString() });
      modelBuilder.Entity&lt;ClientType&gt;().HasData(clientTypes); 
  
  
  
  public class ClientType
  {
      [Key]
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public int Id { get; set; }
  
      [Required]
      [MaxLength(128)]
      public string Name { get; set; }
  
      [MaxLength(512)]
      public string Description { get; set; }
  
      public string Icon { get; set; }
  }
  
  public enum ClientTypeEnum
  {
      NewClient = 1,
      Archived = 2,
  }
  </code></pre>
  
  <p>When I run <code>Add-Migration</code> I get the following error:</p>
  
  <p><code>EF Core The seed entity for entity type 'ClientType' cannot be added because a non-zero value is required for property 'Id'. Consider providing a negative value to avoid collisions with non-seed data.</code></p>
  
  <p>Why is this happening?</p>