예제 #1
0
        public async Task <IActionResult> InsertAsync(ClienteDTO model)
        {
            Response <string> response = new Response <string>();

            try
            {
                if (model == null)
                {
                    return(BadRequest());
                }

                response = await _clienteApplication.InsertAsync(model);

                if (response.IsSuccess)
                {
                    return(Ok(response));
                }
                else
                {
                    return(BadRequest(response));
                }
            }
            catch (Exception ex)
            {
                response.Data      = null;
                response.IsSuccess = false;
                response.Message   = ex.Message;

                return(BadRequest(response));
            }
        }