var query = (from a in upmate
join b in empmat
on a.Value equals b.MaterialCode
into joinupmate
from ter in joinupmate.DefaultIfEmpty()
join c in bfinfo on ter == null ? new Guid() : ter.FileId equals c.Id into joinbf
from bf in joinbf.DefaultIfEmpty()
select new EmployeeMaterialDto()
{
EmployeeId = ter == null ? new Guid() : ter.EmployeeId,
MaterialName = a.Label,
MaterialCode = a.Value,
FileId = ter == null ? new Guid() : ter.FileId,
FilePath = bf == null ? “” : bf.FilePath,
}).ToList();
.net linq多表连接查询
于 2023-02-23 17:09:44 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)