LINQ - Where not exists

后端 未结 3 988
心在旅途
心在旅途 2020-12-08 18:51

What is the equivalent of following statement in LINQ:

Select t1.appname, t1.julianDte, t1.cat 
From table1 t1 
Where NOT EXISTS 
   ( Select * 
     from ta         


        
3条回答
  •  旧时难觅i
    2020-12-08 19:10

    from t1 in Context.table1DbSet
    let ok = 
        (from t2 in Context.table2DbSet 
         where t2.Idt1 = t1.Idt1 && t1.DateValid.HasValue
        ).Any()
    where 
       t1.Active
       && !ok
    

提交回复
热议问题