Ejemplo n.º 1
0
        public async Task <IActionResult> Create([FromBody] UserAddDto userDto)
        {
            _logger.LogInformation($"Users Create");
            if (!ModelState.IsValid)
            {
                _logger.LogWarning($"Users Created BadRequest");
                return(new BadRequestResult());
            }
            User user   = UeserMapper.UserFromAddDto(userDto);
            long userid = await Task.FromResult(_userSrvice.addUser(user));

            var res = new UserRes {
                UserId = userid.ToString()
            };

            _logger.LogInformation($"Users Created: {userid}");
            return(Ok(res));
        }