public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Doctor = await _context.Doctors.FirstOrDefaultAsync(m => m.ID == id); if (Doctor == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Doctor = await _context.Doctors.FindAsync(id); if (Doctor != null) { _context.Doctors.Remove(Doctor); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }