public int Update(BuMenBiao t) { zl.Set <BuMenBiao>().Attach(t); //引用程序集system.data.entity ,引入命名空间System.Data zl.Entry <BuMenBiao>(t).State = EntityState.Modified; return(zl.SaveChanges()); }
public int UpdateYuanGong(YuanGongBiao yg) { context.Set <YuanGongBiao>().Attach(yg); context.Entry <YuanGongBiao>(yg).State = EntityState.Modified; context.SaveChanges(); return(1); }
public int UpdateXueSheng(XueShengBiao stu) { context.Set <XueShengBiao>().Attach(stu); context.Entry <XueShengBiao>(stu).State = EntityState.Modified; context.SaveChanges(); return(1); }
public int Updatejiaoxuejieduan(JiaoXueJieDuanBiao jxjd) { context.Set <JiaoXueJieDuanBiao>().Attach(jxjd); context.Entry <JiaoXueJieDuanBiao>(jxjd).State = EntityState.Modified; return(context.SaveChanges()); }
//修改 public void Modify(T t) { dbcontext.Set <T>().Attach(t); dbcontext.Entry <T>(t).State = EntityState.Modified; }