Join & Left Join
2018-01-10 本文已影响13人
落地成佛
1、Join
1.1定义
image.png1.2结果
image.png2、Left Join
2.1定义
var list = (from teacher in teachers
join student in students on teacher.TeacherId equals student.TeacherId into temp
from tt in temp.DefaultIfEmpty()
select new
{
teacherName = teacher.TeacherName,
studentName = tt?.StudentName
}).Dump("查询语句");