示例#1
0
        public async Task <IActionResult> UpdateUser(int id, [FromBody] Dto.User userDto)
        {
            var user   = _mapper.Map <Domain.User>(userDto);
            var result = await _userService.UpdateUserAsync(id, user);

            return(Ok(new Dto.Response <Dto.User>(_mapper.Map <Dto.User>(result))));
        }
示例#2
0
        public async Task <IActionResult> AddUser(Dto.User userDto)
        {
            var user   = _mapper.Map <Domain.User>(userDto);
            var result = await _userService.AddUserAsync(user);

            return(Ok(new Dto.Response <Dto.User>(_mapper.Map <Dto.User>(result))));
        }