表1 Entities数据集
表2 Fraentity数据集
关联字段
Entities 的 SponsorId
Fraentity 的_id
表2 实体类 FranchiseesBaseInfo
var DataEntity= Entities.GroupJoin(Fraentity, p => p.SponsorId, f => f._id.ToString(), (p, f) => f.DefaultIfEmpty(new FranchiseesBaseInfo()).Select(z=> new AdvertFranDto
{
_id = p._id.ToString(),
FranchiseesName = z.FranchiseesName,
AdvertType = p.AdvertType,
AdvertGroup = p.AdvertGroup,
Title = p.Title,
ImageURL = p.ImageURL,
TurnURL = p.TurnURL,
IsShow = p.IsShow,
AdvertSort = p.AdvertSort,
Price = p.Price,
SponsorId = p.SponsorId,
Provice = p.Provice,
City = p.City,
County = p.County,
EndTime = p.EndTime
})).SelectMany(p=>p).ToList();
网友评论