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