Coming from MVC 5 to asp.net core 2.1.. Add IdentityUser
As the topic says I'm creating a custom add user form. Password will be auto-generated so the only thing the user will submit is their e-mail.
In MVC5 there was a nice account controller. Not so much in core 2.1. Tried scaffolding some stuff and I got some files in Areas/Identity now but not getting any wiser.
How can I register these suckers and save them to the aspnetuser table in the database?
var user = new IdentityUser { UserName = model.Email, Email = model.Email };
var result = _userManager.CreateAsync(user, password);
No errors thrown on stepping through this but nothing is saved to the databse.
0 comments:
Post a Comment