public IHttpActionResult Patch([FromODataUri] decimal key, Delta <USERBID> patch) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } USERBID uSERBID = db.USERBIDS.Find(key); if (uSERBID == null) { return(NotFound()); } patch.Patch(uSERBID); try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!USERBIDExists(key)) { return(NotFound()); } else { throw; } } return(Updated(uSERBID)); }
// PUT: odata/USERBIDs(5) public IHttpActionResult Put([FromODataUri] decimal key, USERBID uSERBID) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (key != uSERBID.ID) { return(BadRequest()); } db.Entry(uSERBID).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!USERBIDExists(key)) { return(NotFound()); } else { throw; } } return(Updated(uSERBID)); }
// POST: odata/USERBIDs public IHttpActionResult Post(USERBID uSERBID) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.USERBIDS.Add(uSERBID); db.SaveChanges(); return(Created(uSERBID)); }
// DELETE: odata/USERBIDs(5) public IHttpActionResult Delete([FromODataUri] decimal key) { USERBID uSERBID = db.USERBIDS.Find(key); if (uSERBID == null) { return(NotFound()); } db.USERBIDS.Remove(uSERBID); db.SaveChanges(); return(StatusCode(HttpStatusCode.NoContent)); }