这两句sql能用linq写出来吗 DELETE d FROM Plan a inner JOIN dbo.Contract c ON a.ID=c.ID INNER JOIN dbo.ContractSub d ON c.SupID=d.ID WHERE c.MType=3 AND a.ID=" + aid
UPDATE d SET d.Pay=c.MPay FROM Plan a inner JOIN dbo.ContractDraft c ON a.ID=c.AID INNER JOIN dbo.ContractSub d ON c.SupID=d.ID WHERE c.MT=2 AND a.ID=" + aid ------解决方案--------------------
var plan = (from a in db.Plan
join c in db.Contract
on a.ID equals c.ID
join d in db.ContractSub
on c.SupID equals d.ID
where c.MType==3 && a.ID==aid
select a)
.Take(1)
.FirstOrDefault();
if(result != null)
{
db.Plan.DeleteObject(plan);
db.SaveChanges();
}