예제 #1
0
        public async Task <IActionResult> Post([FromBody] ClientDto clientInfo)
        {
            try
            {
                if (clientInfo == null)
                {
                    return(BadRequest());
                }

                var client = clientInfo.Adapt <Client>();
                var result = await _createClientService.CreateClient(client);

                return(Ok(result));
            }
            catch (Exception ex)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, new { message = ex.Message }));
            }
        }