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