public IActionResult OnGet(int doctorId) { Doctor = doctorData.GetById(doctorId); if (Doctor == null) { return(RedirectToPage("./NotFound")); } return(Page()); }
public IActionResult OnGet(int?doctorId) { Types = htmlHelper.GetEnumSelectList <DoctorType>(); if (doctorId.HasValue) { Doctor = doctorData.GetById(doctorId.Value); if (Doctor == null) { return(RedirectToPage("./NotFound")); } } else { Doctor = new Doctor(); } return(Page()); }