예제 #1
0
        public IActionResult OnGet(int Id)
        {
            Coffee = coffeeData.GetById(Id);
            if (Coffee == null)
            {
                return(RedirectToPage("NotFound"));
            }

            return(Page());
        }
예제 #2
0
        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());
        }