出于某种原因,在我的地方它说机会实体中不存在“名字”。但它是为 SystemUser 实体设置的。知道为什么会感到困惑吗?谢谢!
var linqQuery = (from r in gServiceContext.CreateQuery("opportunity")
join c in gServiceContext.CreateQuery("account") on ((EntityReference)r["accountid"]).Id equals c["accountid"]
join u in gServiceContext.CreateQuery("systemuser") on ((EntityReference)r["ownerid"]).Id equals u["systemuserid"]
where r["new_leadstatus"].Equals("100000004") && u["lastname"].Equals(rsmLastName) && u["firstname"].Equals(rsmFirstName)
select new
{
AccountId = !r.Contains("accountid") ? string.Empty : r["accountid"],
Account = !r.Contains("name") ? string.Empty : r["name"]
});