public async Task <IActionResult> Edit(string id, [Bind("Id,Returned,OrderID,Region")] Returns returns) { if (id != returns.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(returns); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReturnsExists(returns.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(returns)); }
public async Task <IActionResult> Edit(string id, [Bind("Id,Person,Region")] People people) { if (id != people.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(people); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PeopleExists(people.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(people)); }