- Bring up
Package Manager Console
by clickingTools=>NuGet Package Manager=>Package Manager Console
. - Run
Add-Migration InitialMigration -verbose -StartupProject Maa.Vacations.WebApi -Project Maa.Vacations.Entities
.-Project
means which project contains the DbContext class-StartupProject
means which project contains the Db connection info and other information.
- Update the database by running
Update-Database
.
-
Install these tools.
dotnet tool install --global dotnet-ef
dotnet tool update --global dotnet-ef
-
Run
dotnet ef migrations add InitialMigration -verbose --startup-project Maa.Vacations.WebApi --project Maa.Vacations.Entities
--project
means which project contains the DbContext class--startup-project
means which project contains the Db connection info and other information.
-
Update the database by running
dotnet ef database update
.