onekey

专注.NET技术
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

EF 中ApplyCurrentValues注意

Posted on 2011-05-20 11:41  onekey  阅读(1161)  评论(0编辑  收藏  举报
using (CarleaseEntities ctx = new CarleaseEntities())
            {
                TBL1 T1 = ctx.TBL1.FirstOrDefault(t => t.ID == 1);         //一定要先选择此行
                ctx.TBL1FO.ApplyCurrentValues(T1);
                
                ctx.SaveChanges();
            }