摘要:
EF删除和修改数据只能先从数据库取出,然后再进行删除 delete from Table1 where Id>5; update Table1 set Age=10;我们需要这样操作//删除var t1 = context.Table1.Where(t => t.Id > 5).ToList();foreach(var t in t1){ context.Table1.Remove(t);}context.SaveChange();//更新var t1 = context.Table1.ToList();foreach(var t in t1){ t.Age = 10;}co 阅读全文