public IActionResult OnGet(int carId) { Car = automobilData.GetById(carId); if (Car == null) { return(RedirectToPage("./NotFound")); } return(Page()); }
public IActionResult OnGet(int?carId) { Car = new Automobil(); if (carId.HasValue) { Car = automobilData.GetById(carId.Value); } Goriva = htmlHelper.GetEnumSelectList <GorivoVrsta>(); if (Car == null) { return(RedirectToPage("./NotFound")); } return(Page()); }