How do I create an Auto increment identity column in Entity Framework Core?
Obviously I can do it using fluent API for EF6 for example.
In latest version of EF7 there is a new extension method to set identity column
protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity<MyEntity>(b => { b.HasKey(e => e.Identifier); b.Property(e => e.Identifier).ValueGeneratedOnAdd(); }); }
2.1m questions
2.1m answers
60 comments
57.0k users