The source files refer to freecodecamp.com Blazor WebAssembly course mentioned below.
Base on that, I just attached Migration code files that have not been included on original source code. You can find those in ShopOnline.API > Migrations directory.
-
Screen
-
Course Video
-
Course Source code
-
Course overview
ShopOnlineSolution is part of a Blazor Shopping Cart Application video tutorial demonstrated on YouTube at this location, https://youtu.be/3_AsedRrqww?list=PL4LFuHwItvKbdK-ogNsOx2X58hHGeQm8c
You need to change the SQL server connection string as following your case.
In case of Azure SQL database, that is going to come from ADO.Net connection string.
Server=tcp:{your_azure_db}.database.windows.net,1433;Initial Catalog={db_name}};Persist Security Info=False;User ID={your_id};Password={your_password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
- For creating a migration code
Add-Migration InitialCreateThis command will create a file name such as "20220702030443_InitialCreate.cs". But this will make duplicated Up and Down functions, it will make a collision between "20220702030443_InitialCreate.cs" and "InitialCreate.cs". so that, Before executing "Update-database" you should rename InitialCreate in "InitialCreate.cs" as to "InitialCreate2" or whatever.
- Actual database creation and data are going to be triggered by this command.
Update-databasehttps://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor?view=aspnetcore-6.0