I have tried it in a MVC 5 project and it works. I am now building a Web API 2 based app and need to send out emails to registered users to confirm their registration. I can't use the UserManager. Can anyone help, please?
public async Task<IdentityResult> RegisterUser(UserModel userModel)
{
IdentityUser user = new IdentityUser
{
UserName = userModel.UserName,
Email = userModel.UserName
};
IdentityResult result = await userManager.CreateAsync(user, userModel.Password);
if (result.succeeded)
{
// Cannot use UserManager.GenerateEmailConfirmationTokenAsync(user.Id)
// Send out email for confirmation
}
}
Go to the complete details ...