Search code examples
c#asp.netasp.net-identity

ASP.NET Identity user creation


Just for general understanding, I don't get it why it's been set once to create an ApplicationUser with username and eMail and on the other hand separately a UserManager, which then sets the password:

var user = new ApplicationUser { UserName = model.Email, Email = model.Email };
var result = await UserManager.CreateAsync(user, model.Password);

Btw: I have just created an empty .NET 4.6.1 Application and try to figure out now the different parts.


Solution

  • The UserManager will hash the password, and save the hashed password in the database.