LINQメモ(左外部結合とNVL的なのとWHERE句)
左外部結合
DefaultIfEmptyメソッドを使う
var q = from item1 in Tbl_FOO.Where(p => a.CD_FOO == param) join item2 in Tbl_Hoge on a.CD_AAA equals item2.CD_AAA into a from item2 in a.DefaultIfEmpty()
WHERE句を足したいとき
select aaa from hoge left outer join foo on hoge.cd=foo.cd where foo.CD_NO=1
をLINQで表現すると
var q = from hoge in h join f in Foo.Where(x => x.CD_NO == 1) on new { cd } equals new { cd } into Z from f in Z.DefaultIfEmpty() select { aaa };