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