一直沒弄明白linq 的左鏈接查詢,終於找到解決方案了:
var result = (from a in table1
join b in table2 on a.a_guid equals b.b_guid into t1
from b in t1.DefaultIfEmpty()
join c in table3 on a.a_guid equals c.c_guid into t2
from c in t2.DefaultIfEmpty()
join e in table4 on a.a_userid equals e.e_userid into t3
from e in t3.DefaultIfEmpty()
orderby a.CreateWhen
select new {....});