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