Esempio n. 1
0
        public IActionResult Update(int id, [FromBody] UserDto userDto)
        {
            // map dto to entity and set id
            //var user = _mapper.Map<User>(userDto);
            userDto.Id = id;

            try
            {
                // save
                _userService.Update(userDto, userDto.Password);
                return(Ok());
            }
            catch (AppException ex)
            {
                // return error message if there was an exception
                return(BadRequest(new { message = ex.Message }));
            }
        }