예제 #1
0
        public IActionResult EditProfile(UserEditedDto user)
        {
            var result = _userService.EditProfile(user);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
예제 #2
0
        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));
        }