Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以通过 BlToolkit 中的 linq 编写这样的查询?
SELECT * FROM X pd WHERE EXISTS (SELECT 1 FROM Y mm WHERE VersionMaster > 0 )
我的意思是 - 是否可以在 linq 中编写一个“Exists”构造,以便 BlToolkit 能够理解它?
谢谢
方法 Any() 相当于 sql 中的存在。如下使用。
var query = (from pd in db.TableX where (from mm in db.TableY where mm.VersionNUmber > 0).Any() select pd);
或者
var query = (from pd in db.TableX where db.TableY.Any( mm => mm.VersionNUmber > 0 ) select pd);