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