Entity framework and Exists clause

前端 未结 1 511
清歌不尽
清歌不尽 2021-01-17 16:44

I\'m a rookies of EF so, sorry for my perhaps foolish question.

I\'ve 2 entities without any relationship (VS does not load the join and I can\'t manually add it bec

相关标签:
1条回答
  • 2021-01-17 16:58

    EXISTS in SQL ~= Any in LINQ:

    var q = from p in Context.Products
            where Context.GenericInformation.Any(gi => gi.Product_K == p.Product_K)
            // add other columns to the where if need be; I can't tell what the 
            // relationship is supposed to be
            select p;
    
    0 讨论(0)
提交回复
热议问题