var lists = (from d in _deviceStore.Context.Device.Where(s => !s.IsDeleted)
join dt in _deviceStore.Context.DeviceType on d.DeviceType equals dt.DeviceTypeCode into dt
from dd in dt.DefaultIfEmpty()
join f in _deviceStore.Context.Factory on d.FactoryId equals f.Id into f
from ddf in f.DefaultIfEmpty()
join r in _deviceStore.Context.RepairArea on d.AreaId equals r.Id into r
from ddr in r.DefaultIfEmpty()
join p in _deviceStore.Context.ProductionLine on d.ProductionLineId equals p.Id into p
from ddp in p.DefaultIfEmpty()
select new DeiveInfoModel
{
Id = d.Id,
// ...
}).Where(predicate).OrderByPageInfo(model.PageInfo, out int total);
Linq外联查询Linq的外联查询再此记录只为方便自己查询与使用,如能帮到大家,也欢迎大家伙一起浏览学习与讨论Linq的外联查询var lists = (from d in _deviceStore.Context.Device.Where(s => !s.IsDeleted) join dt in _deviceStore.Context.DeviceType on d.DeviceType equals dt.DeviceTypeCod