EF 的Join查询 ,一般默认是内连接,但是有些情况会需要左连接,则需要如下方式:
//左连接
var query = from r in this.Repository.GetAll()
join d in this._departmentRepository.GetAllIncluding(p => p.Company) on r.DeptId equals d.Id into r_d from dd in r_d.DefaultIfEmpty() //左连接
join p in this._flowProcessRepository.GetAll() on r.Id equals p.Id //内连接
select new AdtoAbsDto
{
Id = r.Id,
Title = r.Title,
CompanyId = dd.Company.Id,
CompanyName = dd.Company.Name,
SchemeCode = p.SchemeCode,
};
标签:Core,Company,EF,连接,ABP,dd,查询,Id From: https://www.cnblogs.com/liaer/p/16910963.html