An ASP.NET Core web application based on the .NET 8. This is a workshop project to learn about Identity framework and how to added it to an existing ASP.NET web application.
-
Add the .NET Core tool for code scaffolding by typing the command below in the .NET CLI:
dotnet tool install dotnet-aspnet-codegenerator --version 8.0.0 --global
-
Install the following packages that includes code generation templates and dependencies that are used by the scaffolder:
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design --version 8.0.0
dotnet add package Microsoft.AspNetCore.Identity.EntityFrameworkCore --version 8.0.0
dotnet add package Microsoft.AspNetCore.Identity.UI --version 8.0.0
dotnet add package Microsoft.EntityFrameworkCore.Design --version 8.0.0
dotnet add package Microsoft.EntityFrameworkCore.SqlServer --version 8.0.0
-
Run the following command to add the default identity components to the project:
dotnet aspnet-codegenerator identity --useDefaultUI --dbContext {projectName + Auth}
-
Install the Entity Framework migration tool:
dotnet tool install dotnet-ef --version 8.0.0 --global
-
Create an EF code migration:
dotnet ef migrations add {Name of migration file}
-
Run the EF migration code to update the database:
dotnet ef database update