https://www.got-it.ai/solutions/sqlquerychat/sql-help/data-query/linq-to-sql-join-table-examples-c-querychat/
INNER JOIN 多条件匹配
var query =
from t1 in myTABLE1List // List<TABLE_1>
join t2 in myTABLE1List
on new { A = t1.ColumnA, B = t1.ColumnB } equals new { A = t2.ColumnA, B = t2.ColumnB }
join t3 in myTABLE1List
on new { A = t2.ColumnA, B = t2.ColumnB } equals new { A = t3.ColumnA, B = t3.ColumnB }
...
LEFT OUTER JOIN
var query =
from t1 in myTABLE1List // List<TABLE_1>
join t2 in myTABLE1List
on new { A = t1.ColumnA, B = t1.ColumnB } equals new { A = t2.ColumnA, B = t2.ColumnB }
into temp from t3 in temp.DefaultIfEmpty()
...
RIGHT OUTER JOIN
var query =
join t2 in myTABLE1List
from t1 in myTABLE1List // List<TABLE_1>
on new { A = t2.ColumnA, B = t2.ColumnB } equals new { A = t1.ColumnA, B = t1.ColumnB }
into temp from t3 in temp.DefaultIfEmpty()
...