linq 左连接

var leftFinal =
from l in lefts
join r in rights on l equals r.Left into lrs
from lr in lrs.DefaultIfEmpty()
select new { LeftId = l.Id, RightId = ((l.Key==r.Key) ? r.Id : 0 };

posted @ 2019-07-25 12:18  向萧  阅读(105)  评论(0编辑  收藏  举报