Пример #1
0
        public async Task <UserDto> UpdateDateOfBirth(int id, DoBDto dateOfBirthDto)
        {
            var user = await _userRepository.GetUser(id);

            if (user == null)
            {
                _logger.LogInformation("Error while updating users date of birth");
                throw new UserNotFoundException();
            }

            var result = await _userRepository.UpdateDoB(id, dateOfBirthDto.DoB);

            return(result);
        }
Пример #2
0
        public async Task <IActionResult> UpdateUsersDateOfBirth(int id, DoBDto dateOfBirthDto)
        {
            var result = await _userService.UpdateDateOfBirth(id, dateOfBirthDto);

            return(Ok(result));
        }