public IActionResult Insert([FromBody] ObjetoVM obj)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                var result = _service.Insert(obj);

                if (result == null)
                {
                    return(NoContent());
                }

                return(Ok(result));
            }
            catch (Exception ex)
            {
                return(BadRequest(new
                {
                    errors = new string[] { "Falha ao inserir: " + ex.Message }
                }));
            }
        }
 public IActionResult Create(Registro registro)
 {
     _registroService.Insert(registro);
     return(RedirectToAction(nameof(Index)));
 }