public async Task <IActionResult> Edit(int id, [Bind("ID,Active,RowVersion")] Subscriber subscriber) { if (id != subscriber.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(subscriber); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SubscriberExists(subscriber.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(subscriber)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Administrator,RowVersion,FirstName,LastName,PhoneNumber,Email")] Employee employee) { if (id != employee.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(employee); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmployeeExists(employee.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(employee)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Price,RowVersion")] Product product) { if (id != product.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(product); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductExists(product.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(product)); }