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