コード例 #1
0
 public async Task <IActionResult> Create(CreateUserViewModel model)
 {
     if (ModelState.IsValid)
     {
         IdentityUser user = new IdentityUser {
             Email = model.Email, UserName = model.Email
         };
         _userManager.Create(user, model.Password);
         //if (result.Succeeded)
         //{
         //    return Ok("Ok");
         //}
         //else
         //{
         //    foreach (var error in result.Errors)
         //    {
         //        ModelState.AddModelError(string.Empty, error.Description);
         //    }
         //}
     }
     return(PartialView(model));
 }