linq 左连接问题
放羊娃儿 2014-09-10 09:27:41 var query = from g in wfEntities.prepay
join p in wfEntities.project on g.ProjectCode equals p.Code
join u in wfEntities.userinfo on g.PrepayUser equals u.ID
join h in wfEntities.userinfo on g.HandlerUserId equals h.ID into ght
from gh in ght.DefaultIfEmpty()
select new PrepayInfoDTO
{
Id = g.Id,
Amount = g.Amount,
PrepayCode = g.PrepayCode,
PrepayDate = g.PrepayDate,
PrepayUser = g.PrepayUser,
PrepayUserName = u.FullName,
HandlerUserId = gh == null ? 0 : gh.ID,
HandlerUserName = gh == null ? "" : gh.FullName,
ProjectCode = g.ProjectCode,
ProjectName = p.Name,
UseNotes = g.UseNotes,
DataState = g.DataState
};
这样子出现了“LINQ to Entities 不识别方法“System.Collections.Generic.IEnumerable”这样的问题?有人知道吗?