public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Appointment = await _context.Appointment .Include(a => a.Category) .Include(a => a.Doctor).FirstOrDefaultAsync(m => m.ID == id); if (Appointment == null) { return(NotFound()); } ViewData["CategoryID"] = new SelectList(_context.Set <Category>(), "ID", "CategoryName"); ViewData["DoctorID"] = new SelectList(_context.Set <Doctor>(), "ID", "DoctorName"); return(Page()); }
public IActionResult OnGet() { ViewData["CategoryID"] = new SelectList(_context.Set <Category>(), "ID", "CategoryName"); ViewData["DoctorID"] = new SelectList(_context.Set <Doctor>(), "ID", "DoctorName"); return(Page()); }