// Create the User Manager var userStore = new UserStore(new ApplicationDbContext()); var userManager = new UserManager (userStore); var applicationUserManager = new ApplicationUserManager(userManager, userStore);
// Create a new user var user = new ApplicationUser { UserName = "testuser", Email = "[email protected]" }; // Add the user to the database var result = await applicationUserManager.CreateAsync(user, "password"); if (result.Succeeded) { // User created successfully } else { // User creation failed }Package Library: Microsoft.AspNet.Identity.Core package library provides the ApplicationUserManager class.