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(); }); }
1.4m articles
1.4m replys
5 comments
57.0k users