现在的位置: 首页 > 综合 > 正文

Linq 左连接 内连接

2012年09月16日 ⁄ 综合 ⁄ 共 267字 ⁄ 字号 评论关闭
//左连接
from a in employeeList
let u = from b in employeeList2
        where a.ID.Equals(b.ID)
        select a
from c in u
select c;

//内连接
from a in employeeList
let u = from b in employeeList2
        where a.ID.Equals(b.ID)
        select a
from c in u.DefaultIfEmpty()
select c;

抱歉!评论已关闭.