Hello,
I add new default values to a table and i need to execute seed method only , any idea ?
Thanks
11 Answer(s)
-
0
If you created seed then run update-database from Package Manager Console.
-
0
Update-Database No migrations were applied. The database is already up to date. Done. I need to make some changes in my Entities ?
-
0
You can run Add-Migration "Execute_Seed" to create an empty migration.
-
0
Hello,
PM> Add-Migration "Execute_Seed" To undo this action, use Remove-Migration. PM> Update-Database Applying migration '20171221220937_Execute_Seed'. Done.
The seed method not running.
Any idea plz ?
-
0
Where is your seed method called?
-
0
Hello,
It's called from InitialHostDbBuilder.Create from the SeedHostDb Helper
-
0
Well, doesn't the Host DB already exist?
-
0
Yeah it's exist but i add new tables and i want to add some default values to those tables so i do the same as default languages but when i run the update database it's not working .
I don't understand why because the first time i run the update database to create Database the seed method has been passed correctly but after that for every new migration when i run the update database i don t see the statement : applying seed method ...
Should i try with the migrator app ?
-
0
Did you run your application?
-
0
Yes the app it's running
-
0
Hello,
It's working now after reloading Visual studio :p .
Thank you ^^