public JsonResult Edit(Employee employee) { CrudOpDbContext db = new CrudOpDbContext(); db.Entry(employee).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(Json(employee, JsonRequestBehavior.AllowGet)); }
public JsonResult Delete(int ID) { CrudOpDbContext db = new CrudOpDbContext(); Employee employee = new Employee(); employee = db.Employees.Find(ID); db.Entry(employee).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); return(Json(employee, JsonRequestBehavior.AllowGet)); }