我有一個下面SQL query
我怎麼能轉換爲lambda
表達如何將以下SQL查詢轉換爲Lambda表達式?
select * from ContractItems where ID in (SELECT distinct contractItemId from ContractPackageItems where contractPackageId in (SELECT ID from ContractPackage where ContractID = 680))
從上述查詢我需要知道,如果行存在與否。如果存在行,則返回true。
-TIA
---更新--- 這是我得到了,但它不工作
(from contractItem in _entities.ContractItems
where contractItem.ID == (from contractPackageItems in _entities.ContractPackageItems
where contractPackageItems.ContractPackageID == (from contractPackage in _entities.ContractPackages where contractPackage.ContractID == contractId select contractPackage.ID) select contractPackageItems.ContractItemId).Distinct()).Any();
Stack Overflow不是代碼翻譯服務。如果您可以向我們展示您已經嘗試過的內容,並解釋發生了什麼與您希望發生的事情,我們更有可能爲您提供幫助。 –