public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(CustomerOrder).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!_context.CustomerOrder.Any(e => e.ID == CustomerOrder.ID)) { return(NotFound()); } throw; } return(RedirectToPage("./Index")); }