Linq 左连接
左连接:
var LeftJoin = from emp in ListOfEmployees join dept in ListOfDepartment on emp.DeptID equals dept.ID into JoinedEmpDept from dept in JoinedEmpDept.DefaultIfEmpty() select new { EmployeeName = emp.Name, DepartmentName = dept != null ? dept.Name : null };
有错误的请多多指教,共同进步(๑•ᴗ•๑)
By听雨的人
By听雨的人