Ok so in entity framework 6 I would have had a key and property database generation in one statement:
modelBuilder.Entity<Function>()
.HasKey(x => x.Id)
.Property(x => x.Id)
.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
In entity framework core (7) this does not work:
modelBuilder.Entity<Function>()
.HasKey(x => x.Id)
.Property(x => x.Id)
.ValueGeneratedNever();
Error: "'KeyBuilder' does not contain a definition for 'Property' and no extension method 'Property' accepting a first argument of type 'KeyBuilder'":
Does this have to be two separate statements as below or is there a way to have it in one like you could in EF6?
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Function>()
.HasKey(x => x.Id);
modelBuilder.Entity<Function>()
.Property(x => x.Id)
.ValueGeneratedNever();
}