public IHttpActionResult PutActor(int id, Actor actor) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != actor.ActorId) { return(BadRequest()); } db.Entry(actor).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ActorExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutMovieBooking(int id, MovieBooking movieBooking) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != movieBooking.MovieBookingId) { return(BadRequest()); } db.Entry(movieBooking).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!MovieBookingExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutvMovieDetail(string id, vMovieDetail vMovieDetail) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != vMovieDetail.MovieName) { return(BadRequest()); } db.Entry(vMovieDetail).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!vMovieDetailExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Putgoal(int id, goal goal) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != goal.goal_id) { return(BadRequest()); } db.Entry(goal).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!goalExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }