I found the problem!
I kept running the command Update-Database
which executes the last generated migrations file.
I deleted the last migration file I created, and ran the command Add-Migration
again which generated a new file with my latest modelBuilder.Entity<OrderDetails>()...
(FluentApi
) code changes I made.
Then ran the command Update-Database
and it worked!
So what I didn't know was that every time you change something in
protected override void OnModelCreating(DbModelBuilder modelBuilder) { ... }
,
you need to execute Add-Migration filename
again.