自产自销,不喜欢匆喷
解决思路,搞不定的地方就用new 加{}
demo
using (var db = DbServices.GetDbProvider())
{
IQueryable<AreaPropertyLogEntity> queryAreaProperty = db.GetQuery<AreaPropertyLogEntity>();
IQueryable<TransferEntity> queryTransfer = db.GetQuery<TransferEntity>();
var query = (from areaPropery in queryAreaProperty
join transfer in queryTransfer on areaPropery.TransferCode equals transfer.TransferCode
where areaPropery.PropId == propId
group new { transfer, areaPropery }
by new
{
ID = areaPropery.ID,
TransferCode = transfer.TransferName,
AreaCode = areaPropery.AreaCode,
AreaName = areaPropery.AreaName,
CanCOD = areaPropery.CanCOD,
CanMovePos = areaPropery.CanMovePos,
CanCWO = areaPropery.CanCWO,
SchemeCode = areaPropery.SchemeCode,
CreateTime = areaPropery.CreateTime,
Creator = areaPropery.Creator,
CreatorID = areaPropery.CreatorID
}
into g
select new AreaPropertyLogEntity
{
ID = g.Key.ID,
TransferCode = g.Key.TransferCode,
AreaCode = g.Key.AreaCode,
AreaName = g.Key.AreaName,
CanCOD = g.Key.CanCOD,
CanMovePos = g.Key.CanMovePos,
CanCWO = g.Key.CanCWO,
SchemeCode = g.Key.SchemeCode,
CreateTime = g.Key.CreateTime,
Creator = g.Key.Creator,
CreatorID = g.Key.CreatorID
}
).ToList();
}