简单linq的sql命令

简单linq的sql命令,sql,linq,Sql,Linq,谁能给我这个简单的LINQ版本。我试着找其他的帖子,但我看到的都是我看不懂的 这可能会对你有所帮助 UPDATE M_User SET id=string1,code=string2,name=string3 WHERE code=certain_str; 林克:什么?实体框架,NHibernate,Linq到SQL?LINQ是一种仅用于查询的语言,不能替代SQL或完整的ORM。每个ORM都有自己的方式将更改发送到数据库,可能会重复 var result = (f

谁能给我这个简单的LINQ版本。我试着找其他的帖子,但我看到的都是我看不懂的

这可能会对你有所帮助

     UPDATE M_User
     SET id=string1,code=string2,name=string3
     WHERE code=certain_str;

林克:什么?实体框架,NHibernate,Linq到SQL?LINQ是一种仅用于查询的语言,不能替代SQL或完整的ORM。每个ORM都有自己的方式将更改发送到数据库,可能会重复
var result =
(from c in db.M_User
where c.Code == certain_Str
select c).First();

// Change the id, code, name
result.id = string1;
result.code = string2;
result.name = string3;

// Ask the DataContext to save all the changes.
db.SubmitChanges();