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