Entityframework修改某个字段

public void ChangePassword(int userId, string password)
{
var user = new User() { Id = userId, Password = password };
using (var db = new MyEfContextName())
{
db.Users.Attach(user);
db.Entry(user).Property(x => x.Password).IsModified = true;
db.SaveChanges();
}
}
上一篇:poj 2823 Sliding Window (单调队列入门)


下一篇:Android自动读取短信验证码