public async Task <IActionResult> PutUser(int id, User user) { if (id != user.UserID) { return(BadRequest()); } _context.Entry(user).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult Edit([Bind(Include = "DirectorId,Name,DateOfBirth,DirectorSummary")] Director director) { if (ModelState.IsValid) { db.Entry(director).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(director)); }