public IActionResult OnGet(int Id) { Coffee = coffeeData.GetById(Id); if (Coffee == null) { return(RedirectToPage("NotFound")); } return(Page()); }
public IActionResult OnGet(int?Id) { CoffeeTypes = htmlHelper.GetEnumSelectList <CoffeeType>(); if (Id.HasValue) { Coffee = coffeeData.GetById(Id.Value); } else { Coffee = new Coffee(); } if (Coffee == null) { return(RedirectToPage("NotFound")); } return(Page()); }