public IActionResult EditProfile(UserEditedDto user) { var result = _userService.EditProfile(user); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public IResult EditProfile(UserEditedDto user) { byte[] passwordHash; byte[] passwordSalt; HashingHelper.CreatePasswordHash(user.Password, out passwordHash, out passwordSalt); User editedUser = new User { Id = user.Id, FirstName = user.FirstName, LastName = user.LastName, Email = user.Email, PasswordHash = passwordHash, PasswordSalt = passwordSalt, Status = true }; _userDal.Update(editedUser); return(new SuccessResult(Messages.UserUpdated)); }