public IHttpActionResult PutActivite(int id, Activite activite) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != activite.Id) { return(BadRequest()); } db.Entry(activite).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ActiviteExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutPublicitNavBar(int id, PublicitNavBar publicitNavBar) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != publicitNavBar.ID) { return(BadRequest()); } db.Entry(publicitNavBar).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PublicitNavBarExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }