public async Task<IActionResult> UpdateInfo(UpdateInfoDTO dto){ if (!ModelState.IsValid) { ViewBag.Errors = ModelState.Values.SelectMany(e => e.Errors).Select(e => e.ErrorMessage).ToList(); return View(dto); } ApplicationUser user = new ApplicationUser { UserName = dto.UserName, PersonName = dto.PersonName, Email = dto.Email, PhoneNumber = dto.Phone, ProfilePicPath = dto.ProfilePicture }; user.SecurityStamp = Guid.NewGuid().ToString(); var result = await _userManager.UpdateAsync(user); if (result.Succeeded) { return RedirectToAction(nameof(HomeController.Index), "Home"); } else { foreach (IdentityError error in result.Errors) { ModelState.AddModelError("UpdateInfo", error.Description); } return View(dto); }}