Пример #1
0
        public async Task <IActionResult> Edit(EditUserViewModel model)
        {
            if (ModelState.IsValid)
            {
                IdentityUser user = _userManager.GetById(model.Id);
                if (user != null)
                {
                    user.Email    = model.Email;
                    user.UserName = model.Email;

                    _userManager.Edit(user);
                    //if (result.Succeeded)
                    //{
                    //    return Ok("Ok");
                    //}
                    //else
                    //{
                    //    foreach (var error in result.Errors)
                    //    {
                    //        ModelState.AddModelError(string.Empty, error.Description);
                    //    }
                    //}
                }
            }
            return(PartialView(model));
        }