EF6 按条件更新多行记录的值

using (var db = new MyDbContext())
{
string fromUser = ""; //sender
string toUser = ""; //receiver
var messages = db.Message.Where(x => x.FromUser == fromUser && x.ToUser == toUser)
.ToList();
messages.ForEach(m => m.IsRead = true);
db.SaveChanges();
}
上一篇:JXLS导出Excel(模板导出)


下一篇:Spring的Cache注解