public async Task <ActionResult <User> > PutUser(User user) { if (!ModelState.IsValid) { return(BadRequest()); } _context.Entry(user).State = EntityState.Modified; try { await _context.SaveChangesAsync(); return(user); } catch (DbUpdateConcurrencyException) { if (!UserExists(user.ID)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutActor(int id, Actor actor) { if (id != actor.ID) { return(BadRequest()); } _context.Entry(actor).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ActorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }