filmov
tv
How to Initialize a Clean ASP.NET Core Project with Entity Framework Core and Identity
![preview_player](https://i.ytimg.com/vi/3NGz1G_HF94/maxresdefault.jpg)
Показать описание
In this video, you will learn the steps to apply to initialize a brand-new project that utilizes ASP.NET Core Razor pages, backed by Entity Framework Core on the SQL Server, and authenticated using Identity.
The end result of the sequence of steps demonstrated in this video is the Web application project which can evolve using different architectural patterns and styles, yet the project which has all the mandatory elements in place at its outset.
All operations required to initialize the solution and the project, and to add package references to it have been exercised using CLI tools. You can find the list of all commands issued below. Combine this script with the content of the video to bootstrap a new Web application project in time no longer than 5-10 minutes.
Chapters:
00:00 Intro
02:45 Initializing the project
05:27 Setting up the Identity schema
08:37 Adding the domain model and subdomains
Commands to initialize the ASP.NET Razor pages application with Entity Framework Core and Identity:
I Install/update the tools
dotnet tool install -g dotnet-ef
or
dotnet tool update -g dotnet-ef
dotnet tool install -g dotnet-aspnet-codegenerator
or
dotnet tool update -g dotnet-aspnet-codegenerator
II Create the project
dotnet new sln -o SOLUTION_FILE.sln
dotnet new razor -o PROJECT_DIRECTORY
dotnet sln add PROJECT_FILE_PATH
III Add Entity Framework Core packages to the project
dotnet add PROJECT_FILE_PATH package Microsoft.EntityFrameworkCore.Design
dotnet add PROJECT_FILE_PATH package Microsoft.EntityFrameworkCore.SqlServer
dotnet add PROJECT_FILE_PATH package Microsoft.EntityFrameworkCore.Tools
IV Add Identity packages to the project
dotnet add PROJECT_FILE_PATH package Microsoft.VisualStudio.Web.CodeGeneration.Design
dotnet add PROJECT_FILE_PATH package Microsoft.AspNetCore.Identity.EntityFrameworkCore
dotnet add PROJECT_FILE_PATH package Microsoft.AspNetCore.Identity.UI
V Generate Identity pages, migration and update the database
dotnet aspnet-codegenerator identity --project PROJECT_FILE_PATH
dotnet ef migrations add CreateIdentitySchema --project PROJECT_FILE_PATH
dotnet ef database update --project PROJECT_FILE_PATH
Learn more from video courses:
Other videos on this channel you may be interested in watching:
#aspnetcore #dotnet #cleancode
Комментарии