Troubleshooting and fix Initial Migration and seed data for Entity Framework Core Project
Budget: $30 – $250 USD
I am trying to troubleshoot the error generated by the project I posted at :
https://github.com/pierre01/TestWebAPI
When calling "add-migration CreateMigration" under the package manager console.
I receive an error:
"The seed entity for entity type 'Dish' with the key value 'Id:b4d10e0e-c589-4bd4-9e9e-1d2b6350451e' cannot be added because it has the navigation 'WinesForThisDish' set. To seed relationships, add the entity seed to 'WineForDish' and specify the foreign key values {'DishId'}."
I need help to troubleshoot and fix the error probably due to missing instructions in the DBContext OnModelCreating or the entities I am creating and seeding.
Minimal changes should be done to the data creation.
https://github.com/pierre01/TestWebAPI
When calling "add-migration CreateMigration" under the package manager console.
I receive an error:
"The seed entity for entity type 'Dish' with the key value 'Id:b4d10e0e-c589-4bd4-9e9e-1d2b6350451e' cannot be added because it has the navigation 'WinesForThisDish' set. To seed relationships, add the entity seed to 'WineForDish' and specify the foreign key values {'DishId'}."
I need help to troubleshoot and fix the error probably due to missing instructions in the DBContext OnModelCreating or the entities I am creating and seeding.
Minimal changes should be done to the data creation.