The database is not getting created after Add-migration command when using ASP.Net Core 6.0 web application.
Connection string given below (i am using local db for testing/learning purpose)
"ConnectionStrings": { "DefaultConnection": "Server=(localdb)\local; Database=PradeepShopping; Trusted_Connection=True" }
The database is not getting created.
CodePudding user response:
Hi you need to do another step.
After "add-migration", you have to call "update-database"
CodePudding user response:
- Run
view
->terminal
in Visual Studio. - Type
cd ./{your projectname with migrations}
. - Run
dotnet ef database update
.
Done.
p.s.
To rollback database or apply specify migration use:
dotnet ef database update {migration name}