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