title: How to change this from manually putting in an Id to auto incrementing
body: <p>There are quite a few little write ups on this, but I cannot quite get it.</p>
  
  <p>This code works, but I have to manually specify an Id, Id is a foreign key to several other tables:</p>
  
  <p>Seed</p>
  
  <pre><code>new Party {Id = "01", startDate = DateTime.Now, endDate = DateTime.Now }
  </code></pre>
  
  <p>Model</p>
  
  <pre><code> public class Party
      {
          public string Id { get; set; }
          [DisplayFormat(DataFormatString = "{0:d}")]
          public DateTime startDate { get; set; }
          [DisplayFormat(DataFormatString = "{0:d}")]
          public DateTime endDate { get; set; }
      }
  </code></pre>
  
  <p>What I am wanting to do is this though, but when I run <code>Update-Database -Verbose</code>, it throws an error saying the Id is being referenced by another table. How do I make <code>Id</code> auto generate so that I do not have to reference it when creating a party?:</p>
  
  <p>Seed</p>
  
  <pre><code>new Party {startDate = DateTime.Now, endDate = DateTime.Now }
  </code></pre>
  
  <p>Model</p>
  
  <pre><code> public class Party
      {
         [Key]
          public string Id { get; set; }
          [DisplayFormat(DataFormatString = "{0:d}")]
          public DateTime startDate { get; set; }
          [DisplayFormat(DataFormatString = "{0:d}")]
          public DateTime endDate { get; set; }
      }
  </code></pre>