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();
}