title: Auto-increment on partial primary key with Entity Framework Core
body: <p>I have declared the following model using the EF Core fluent API:</p>
  
  <pre><code>modelBuilder.Entity&lt;Foo&gt;()
      .HasKey(p =&gt; new { p.Name, p.Id });
  </code></pre>
  
  <p>Both fields are marked as the primary key when I create the database in PostgreSQL but the Id field is not marked as auto increment. I have also tried to add</p>
  
  <pre><code>[Key]
  [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
  </code></pre>
  
  <p>to the Id field under Foo without it making any difference on the migration code. Is there a way to make the Id AI although it is a PPK?</p>