【发布时间】:2011-12-29 21:14:13
【问题描述】:
我有这个问题:
(from r in gServiceContext.CreateQuery("opportunity")
join c in gServiceContext.CreateQuery("contact") on ((EntityReference)r["new_contact"]).Id equals c["contactid"]
join n in gServiceContext.CreateQuery("annotation") on r["opportunityid"] equals ((EntityReference)n["objectid"]).Id into opp
from o in opp.DefaultIfEmpty().ToList()
where ((EntityReference)r["new_channelpartner"]).Id.Equals(lProfileProperty.PropertyValue) && ((OptionSetValue)r["new_leadstatus"]).Equals("100000002")
使用 ToList() 我收到此错误:
方法'GroupJoin'不能跟随方法'Join'或者不是 支持的。尝试根据支持的方法编写查询或调用 调用不支持之前的“AsEnumerable”或“ToList”方法 方法。
如果我关闭 ToList,我会得到同样的错误。有没有办法解决这个问题,还是我做错了?
谢谢!
旁注:我使用的是 DefaultIfEmpty,因为即使它加入的记录为 NULL,我仍需要它来下拉记录。
【问题讨论】: