-
Ensure your connection strings in
appsettings.json
point to a local SQL Server instance. -
Ensure the tool EF was already installed. You can find some help here
dotnet tool update --global dotnet-ef
-
Open a command prompt in the Web folder and execute the following commands:
dotnet ef database update --context EshopContext -p EshopOnVue.js.Infrastructure/EshopOnVue.js.Infrastructure.csproj -s EshopOnVue.js.Spa/EshopOnVue.js.Spa.csproj
These commands will create two separate databases, one for the store's catalog data and shopping cart information, and one for the app's user credentials and identity data.
-
Run the application.
The first time you run the application, it will seed both databases with data such that you should see products in the store, and you should be able to log in using the demouser@microsoft.com account.
Note: If you need to create migrations, you can use these commands:
-- create migration (from .sln folder CLI) dotnet ef migrations add Basket --context EshopContext -p EshopOnVue.js.Infrastructure/EshopOnVue.js.Infrastructure.csproj -s EshopOnVue.js.Spa/EshopOnVue.js.Spa.csproj -o Data/Migrations