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