public IHttpActionResult PutPostNrTabel(int id, PostNrTabel postNrTabel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != postNrTabel.PostNr) { return(BadRequest()); } db.Entry(postNrTabel).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PostNrTabelExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutMonumentOversigt(int id, MonumentOversigt monumentOversigt) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != monumentOversigt.Global_Id) { return(BadRequest()); } db.Entry(monumentOversigt).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!MonumentOversigtExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutPlaceringsTyper(int id, PlaceringsTyper placeringsTyper) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != placeringsTyper.Placerings_Id) { return(BadRequest()); } db.Entry(placeringsTyper).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PlaceringsTyperExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }