This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| nebolcontroller_netcore_mssql_adjustments [2021/07/31 11:11] – nebol | nebolcontroller_netcore_mssql_adjustments [2021/08/02 03:07] (current) – nebol | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ==== WORK IN PROGRESS ==== | ||
| DAL project: | DAL project: | ||
| - | Install-Package Microsoft.EntityFrameworkCore.SqlServer | + | < |
| Install-Package Microsoft.EntityFrameworkCore.Design | Install-Package Microsoft.EntityFrameworkCore.Design | ||
| + | Install-Package Microsoft.EntityFrameworkCore.SqlServer # if needed for any MSSQL stuff in your DbContext | ||
| + | </ | ||
| Add Models | Add Models | ||
| - | |||
| Add a DbContext | Add a DbContext | ||
| Line 65: | Line 67: | ||
| </ | </ | ||
| + | === Update Entity Framework Tools if needed === | ||
| + | PM> dotnet tool update --global dotnet-ef | ||
| + | |||
| + | |||
| + | === Create a migration === | ||
| + | < | ||
| + | dotnet ef migrations add InitialCreate --project MyProject.DAL | ||
| + | </ | ||
| + | |||
| + | === Update the database === | ||
| + | < | ||
| + | dotnet ef database update --project Mixer.DAL | ||
| + | </ | ||
| Main project: | Main project: | ||