Convert SQL to Linq left join with null

前端 未结 4 724
臣服心动
臣服心动 2020-12-08 09:10

How can I convert properly this SQL to linq

select  t1.ProgramID
from Program t1 LEFT JOIN ProgramLocation t2 ON  t1.ProgramID = t2.ProgramID 
where t2.Progr         


        
4条回答
  •  时光说笑
    2020-12-08 09:28

    Could you use except instead?

    var progy = (
      from u in db.ProgramLocations
      select u.ProgramID
    ).Except(from b in db.Programs select b.ProgramID);
    

提交回复
热议问题