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