public ActionResult Delete([FromQuery] String name) { Iso8583RouterComm oldObj = this.entityManager.Set <Iso8583RouterComm> ().Find(name); this.entityManager.Remove(oldObj); this.entityManager.SaveChanges(); return(this.Ok()); }
public ActionResult <Iso8583RouterComm> Update([FromQuery] String name, [FromBody] Iso8583RouterComm newObj) { if (String.Equals(name, newObj.Name) == false) { Iso8583RouterComm oldObj = this.entityManager.Set <Iso8583RouterComm> ().Find(name); this.entityManager.Entry(oldObj).State = EntityState.Detached; } this.entityManager.Update(newObj); this.entityManager.SaveChanges(); return(newObj); }
public ActionResult <Iso8583RouterComm> Create([FromBody] Iso8583RouterComm obj) { entityManager.Add(obj); entityManager.SaveChanges(); return(obj); }