Exemplo n.º 1
0
        public IHttpActionResult UpdateById([FromBody] UserUpdateDetails updateDetails)
        {
            Guid authenticatedUserId = ClaimsHelper.GetUserIdFromClaims();
            var  user = _context.Users.UpdateById(authenticatedUserId, updateDetails);

            return(Ok(ConvertToServiceLayerUser(user)));
        }
Exemplo n.º 2
0
        public User UpdateById(Guid id, UserUpdateDetails updateDetails)
        {
            var user = _usersDAL.ReadById(id);

            if (user == null)
            {
                throw new ValidationException("Cannot update inexistent user!");
            }

            //user.PasswordHash = GetPasswordHash(updateDetails.Password);
            user.FirstName = updateDetails.FirstName;
            user.LastName  = updateDetails.LastName;
            user.Email     = updateDetails.Email;

            return(_usersDAL.UpdateById(id, user));
        }
 public UpdateUserDetailsCommand(string id, UserUpdateDetails updateDetails)
 {
     Id           = id;
     UpdateDetais = updateDetails;
 }