public IHttpActionResult PutWorkTrip(long id, Dal.Invitation.Interfaces.WorkTrip workTrip) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != workTrip.Id) { return(BadRequest()); } db.Entry(workTrip).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!WorkTripExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutUsers(long id, Users users) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != users.Id) { return(BadRequest()); } db.Entry(users).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!UsersExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutAssociatedGroupWall(long id, AssociatedGroupWall associatedGroupWall) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != associatedGroupWall.Id) { return(BadRequest()); } db.Entry(associatedGroupWall).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!AssociatedGroupWallExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }