public IActionResult OnGet(int bikeId) { Bike = bikeData.GetById(bikeId); if (Bike == null) { return(RedirectToPage("./NotFound")); } return(Page()); }
public IActionResult OnGet(int?bikeId) { Manufacturers = htmlHelper.GetEnumSelectList <Bike.BikeManufacturer>(); if (bikeId.HasValue) { Bike = bikeData.GetById(bikeId.Value); } else { Bike = new Bike(); } if (Bike == null) { return(RedirectToPage("./NotFound")); } return(Page()); }