//[HttpPost] public IHttpActionResult UpdateApi(APIemp em) { Step2017Entities2 en = new Step2017Entities2(); en.Entry(em).State = EntityState.Modified; en.SaveChanges(); return(Ok()); }
public IHttpActionResult PostApi(APIemp em) { Step2017Entities2 en = new Step2017Entities2(); en.APIemps.Add(em); en.SaveChanges(); return(Ok()); }
public IHttpActionResult DeleteApi(int id) { Step2017Entities2 en = new Step2017Entities2(); APIemp em = new APIemp(); var id1 = en.APIemps.Where(c => c.id == id).FirstOrDefault(); en.APIemps.Remove(id1); en.SaveChanges(); return(Ok()); }