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