project-future-six-dotnet-academy
Code.Hub | .NET Cloud Tools and Technology Academy
The main project for all lessons is the LessonOne/DI.TinyCrm.Web web application. It is an ASP.NET Core MVC 6 web application.
To run the migrations for the project
- Right click on solution in Visual Studio
- Click "Open in Terminal"
- Type the following command:
- dotnet ef database update --project LessonOne\DI.TinyCrm.Persistence --startup-project LessonOne\DI.TinyCrm.Web
In order to run the above command you have to open the appSettings.json file and put in the correct connection string that points to your SQL server instance running in your machine.
To create new migrations for the project and experiment:
- Do the necessary changes in your Entities
- Right click on solution in Visual Studio
- Click "Open in Terminal"
- Type the following command:
- dotnet ef migrations add "{MigrationName}" --project LessonOne\DI.TinyCrm.Persistence --startup-project LessonOne\DI.TinyCrm.Web --output-dir Migrations
- Then once again you run:
- dotnet ef database update --project LessonOne\DI.TinyCrm.Persistence --startup-project LessonOne\DI.TinyCrm.Web