如何使用 entity framework 和 linq 编写此 sql 查询

How can I write this sql query using entity framework and linq

我可以用 entity framework

中的相同概念编写下面提到的查询吗
update o set o.Name='NewName'
from Organization o
Inner join Guardian g on o.OrgRowId=g.OrgRowId
where g.IsEnabled=1 and g.OrgRowId=1

求指导!!!

更新

根据要求,这是我能够使用连接编写 select 查询的内容,但无法在同一查询中进行更新

var query = from o in Organizations             
                join g in Guardians on o.OrgRowId equals g.OrgRowId             
                where g.IsEnabled && g.GuardianRowId==1             
                select o;

更新1 Kilanny,我试过你像这样查询和更新我的,但它没有效果,我在 Linqpad运行 这些查询

using (var context = new DbEntities())
{
    var query = from o in Organizations
                join g in Guardians on o.OrgRowId equals g.OrgRowId
                where g.IsEnabled && g.GuardianRowId == 1
                select o;
    foreach (var item in query)
    {       
        item.Name="New Organization Name";
        context.SaveChanges();
    }   
    query.Dump();
}
var query = from o in Organizations             
            join g in Guardians on o.OrgRowId equals g.OrgRowId             
            where g.IsEnabled && g.GuardianRowId==1             
            select o;
foreach (var item in query)
   item.Name="NewName";
entities.SaveChanges();