예제 #1
0
 public IActionResult Cadastro(CategoriaViewModel categoria)
 {
     try
     {
         if (ModelState.IsValid)
         {
             ServicoAplicacaoCategoria.CadastrarCategoria(categoria);
             return(RedirectToAction("Index"));
         }
         else
         {
             return(View(categoria));
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }