想要将给定的SQL转换为Linq

时间:2018-06-14 10:15:11

标签: entity-framework linq linq-to-sql linq-to-entities

enter image description here

SELECT        Project_ID, Project_Title, Project_Domain, Project_Type, Project_Technology, Project_Description
FROM            PSS_Project
WHERE        (Project_ID IN
                             (SELECT        Project_ID
                               FROM            PSS_Project_Group
                               WHERE        (Company_ID IN
                                                             (SELECT        Company_ID
                                                               FROM            PSS_Employee
                                                               WHERE        (Employee_User_ID = 'E0001')))))

在SQl上面,我写了On LINQ AS:

(from x in DB.PSS_Project where x.Project_ID==(from P in DB.PSS_Project_Group where P.Company_ID==(from E in DB.PSS_Employee where E.Employee_User_ID==id select E.Company_ID).FirstOrDefault() select P.Project_ID).FirstOrDefault() select x)

但它不会向我提供有效的输出为SQL

0 个答案:

没有答案