2010-02-08 52 views

回答

5

嘗試:

from t3 in dataContext.Table3 
    where t3.Guidfield == someGuid 
    from t2 in t3.Table2 
    where t2.Field // boolean field is true 
    select t2.Table1; 

編輯:按照要求,相當於lambda表達式語法:

dataContext.Table3.Where(t3 => t3.Guidfield == someGuid) 
       .SelectMany(t3 => t3.Table2) 
       .Where(t2 => t2.Field) 
       .Select(t2.Table1); 
+0

如何將這項轉換爲點記號? – Sako73 2010-02-09 02:17:11

+0

編輯過的文章提供了lambda表達式語法示例。 – 2010-02-09 08:32:08

+0

很好的答案。謝謝。 – Sako73 2010-02-09 13:57:28

0
from t1 in table1 
join t2 in table2 
on t1.table1PK equals t2.table1PK 
join t4 in table4 
on t2.table2PK equals t4.table2PK 
join t3 in table3 
on t3.table3PK equals t4.table3PK 
where t2.randomBoolColumn == true && t3.GUID == myGUIDVariable 
select t1;