public IActionResult Index() { var cardapioServico = new CardapioServico(); var cardapio = cardapioServico.ListarCardapio(); return(View(cardapio)); }
public IActionResult Index() { try { var cardapioServico = new CardapioServico(); var cardapio = cardapioServico.ListarCardapio(); ViewBag.Error = ""; return(View(cardapio)); } catch (Exception ex) { ViewBag.Error = ex.ToString(); return(View(new List <Pizza>())); } }