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