在 LINQ to Entities 查询中无法构造实体或复杂类型
我要做一个链接查询left join
ViewBag.List = (from a in Member
join b in MemberInfo on a.MemberId equals b.MemberId into ab
from c in ab.DefaultIfEmpty(new MemberInfo() { RealName = "hehe" })
select new { a.MemberId, c.RealName }).ToList();
ViewBag.List = (from a in Member
join b in MemberInfo on a.MemberId equals b.MemberId into ab
from c in ab.DefaultIfEmpty()
select new { a.MemberId, RealName =c==null?"hehe":c.RealName }).ToList();