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