示例#1
0
        public IActionResult UpdateGameStats(int id, [FromBody] UserDto userDto)
        {
            // map dto to entity and set id
            var user = _mapper.Map <Users>(userDto);

            user.Id = id;

            try
            {
                // save
                _gameStatsService.UpdateGameStats(user);
                return(Ok());
            }
            catch (AppException ex)
            {
                // return error message if there was an exception
                return(BadRequest(new { message = ex.Message }));
            }
        }