public IActionResult OnGet(int id) { Appointment = appointmentData.GetAppointmentById(id); if (Appointment == null) { return(RedirectToPage("./NotFound")); } return(Page()); }
public IActionResult OnGet(int?id) { if (id.HasValue) { Appointment = appointmentData.GetAppointmentById(id.Value); if (Appointment == null) { return(RedirectToPage("./NotFound")); } } else { Appointment = new Core.Appointment(); } var patients = patientData.GetPatients().ToList().Select(p => new { Id = p.Id, Display = $"{p.FirstName} {p.LastName}" }); Patients = new SelectList(patients, "Id", "Display"); Symptom = htmlHelper.GetEnumSelectList <Symptom>(); return(Page()); }