示例#1
0
        public IActionResult Post([FromBody] UsuarioVm viewModel)
        {
            if (ModelState.IsValid == false)
            {
                return(BadRequest("The information is invalid"));
            }

            try
            {
                var resultado = _servicio.Registrar(viewModel);
                if (resultado.EsValido)
                {
                    return(Ok());
                }
                else
                {
                    return(BadRequest("The register can't complete"));
                }
            }
            catch (Exception)
            {
                return(BadRequest("The register can't complete"));
            }
        }