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