public IActionResult OnGet(int granolaId) { Granola = granolaData.GetById(granolaId); if (Granola == null) { return(RedirectToPage("./ErrorPage")); } return(Page()); }
public IActionResult OnGet(int?granolaId) { Tipos = htmlHelper.GetEnumSelectList <GranolaTipo>(); if (granolaId.HasValue) { Granola = granolaData.GetById(granolaId.Value); } else { Granola = new Granola(); } if (Granola == null) { return(RedirectToPage("./ErrorPage")); } return(Page()); }