inner join 模板:
- var query = from x in db.T1
- join y in db.T2
- on x.Id equals y.Id
- select x;
left join模板:
- var query = from x in db.T1
- join y in db.T2
- on x.yId equals y.Id into temp
- from ret in temp.DefalutIfEmpty()
- select new{ x.Id, ret};
经常记不住,这次把它记下来!