Create User In Asp.net Core Identity | User Management in Asp.net Core C# | SignUp API | Part-2

Опубликовано: 28 Сентябрь 2024
на канале: Code with Salman
28,825
358

ASP.NET Core Identity UserManager class of Microsoft.AspNetCore.Identity namespace helps to manage Identity users stored in the database. The generic version of this class is UserManager T where T is the class chosen to represent users. We will be using this class to perform CRUD operations for the users.

To create new Users in ASP.NET Core Identity we will need a C# Class. So create a new class called User.cs inside the Models folders. Next, add 3 public properties to it, which are Name, Email & Password, each of type string. Also add [Required] validation attributes to all of them.

We also add RegularExpression valiation attribute over the Email property to valdiate proper email entries.