public async Task <IActionResult> Edit(int id, [Bind("CustomerID,Name,Adress,BirthDate")] Customer customer) { if (id != customer.CustomerID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(customer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomerExists(customer.CustomerID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(customer)); }