// POST: odata/BenthicMonitorLogs public IHttpActionResult Post(BenthicMonitorLog benthicMonitorLog) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.BenthicMonitorLogs.Add(benthicMonitorLog); db.SaveChanges(); return(Created(benthicMonitorLog)); }
// DELETE: odata/BenthicMonitorLogs(5) public IHttpActionResult Delete([FromODataUri] int key) { BenthicMonitorLog benthicMonitorLog = db.BenthicMonitorLogs.Find(key); if (benthicMonitorLog == null) { return(NotFound()); } db.BenthicMonitorLogs.Remove(benthicMonitorLog); db.SaveChanges(); return(StatusCode(HttpStatusCode.NoContent)); }
// PUT: odata/BenthicMonitorLogs(5) public IHttpActionResult Put([FromODataUri] int key, Delta <BenthicMonitorLog> patch) { Validate(patch.GetEntity()); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } BenthicMonitorLog benthicMonitorLog = db.BenthicMonitorLogs.Find(key); if (benthicMonitorLog == null) { return(NotFound()); } patch.Put(benthicMonitorLog); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!BenthicMonitorLogExists(key)) { return(NotFound()); } else { throw; } } return(Updated(benthicMonitorLog)); }