public IActionResult OnGet(int?id) { if (id.HasValue) { Patient = patientData.GetPatientById(id.Value); if (Patient == null) { return(RedirectToPage("./NotFound")); } } else { Patient = new Core.Patient(); } var doctors = doctorData.GetDoctors().ToList().Select(d => new { Id = d.Id, Display = $"{d.FirstName} {d.LastName}" }); Doctors = new SelectList(doctors, "Id", "Display"); Gender = htmlHelper.GetEnumSelectList <Gender>(); return(Page()); }
public void OnGet() { Doctors = doctorData.GetDoctors(); }