Exemplo n.º 1
0
        public ActionResult Create([FromBody] CreateClienteRequest request)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState.GetErrorResponse()));
                }

                var response = _service.Create(request);

                if (!response.Success)
                {
                    return(BadRequest(response.Erros));
                }

                return(Ok());
            }
            catch (Exception ex)
            {
                return(BadRequest(ex));
            }
        }