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