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