public async Task <IActionResult> Put(UserDTO userDTO) { try { if (!ModelState.IsValid) { return(BadRequest(Messages.InvalidModel)); } if (!(await _user.CheckUserByUserId(userDTO.UserId))) { return(BadRequest(Messages.UserNotExist)); } if ((await _user.CheckUserExist(userDTO.UserName, _user.UserPassword(userDTO.UserId), userDTO.UserId))) { return(BadRequest(Messages.UserExist)); } return(Ok(await _user.Put(userDTO))); } catch (Exception ex) { return(BadRequest(Messages.GeneralError)); } }