onekey

专注.NET技术
posts - 21, comments - 21, trackbacks - 0, articles - 2
  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理

EF 中ApplyCurrentValues注意

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