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