Low Ceremony Initializing Clean ASP.NET Core Project with EF Core and Identity



Low Ceremony Initializing Clean ASP.NET Core Project with EF Core and Identity

Low Ceremony Initializing Clean ASP.NET Core Project with EF Core and Identity

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_PATHj 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

Video courses:
Beginning Object-oriented Programming with C# ► https://codinghelmet.com/go/beginning-oop-with-csharp
Collections and Generics in C# ► https://codinghelmet.com/go/collections-and-generics-in-cs
Making Your C# Code More Object-oriented ► https://codinghelmet.com/go/making-your-cs-code-more-oo

Other courses at Pluralsight ► https://codinghelmet.com/go/pluralsight
Other courses at Udemy ► https://codinghelmet.com/go/udemy

Additional videos:
The Fastest Way to Modify a List in C# ► https://youtu.be/0oSN65eM-tc
Coding with GitHub Copilot – Beginner to Master ► https://youtu.be/B9DKv09IfT4
Want to Start with DDD? Try Ubiquitous Language First! ► https://youtu.be/_zWMjMUHinc
Using C# Record Types ► https://youtu.be/VouNkrgkH78
Covariance and Contravariance in C# ► https://youtu.be/Wp5iYQqHspg
How do Virtual Functions Work? ► https://youtu.be/b0IDTWoaUJ0

Practical Design playlist at YouTube ► https://youtube.com/playlist?list=PLSDYwLgFqaX78eEg_YKs0wHmOMi7_ggZr

Comments are closed.