Code.Hub | .NET PF6 Academy
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