title: Auto-Incremented value not working in PostgreSQL when using EntityFramework Core
body: <p>It seems like the auto-increment function for PostgreSQL doesn't seem to work.</p>
  
  <p>I have the following code:</p>
  
  <pre><code>namespace project.Models
  {
     public class DatabaseModel
     {
         [Key]
         [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
         [Column(Order=1, TypeName="integer")]
         public int ID { get; set; }
     }
   }
  </code></pre>
  
  <p>When I update the database (after doing a migration) the ID column is the primary key without being a auto-increment.</p>
  
  <p>When I try to add a new object to the database I get the following error:</p>
  
  <pre><code>Microsoft.EntityFrameworkCore.DbContext[1]
    An exception occurred in the database while saving changes.
    Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---&gt; Npgsql.PostgresException: 23502: null value in column "ID" violates not-null constraint
  </code></pre>
  
  <p>Can anyone help solve this problem? How can I get the key to be auto-incremented?</p>