Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/315.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 有没有办法在Dynamics CRM API中与OData一起使用join?_C#_Rest_Api_Dynamics Crm_Postman - Fatal编程技术网

C# 有没有办法在Dynamics CRM API中与OData一起使用join?

C# 有没有办法在Dynamics CRM API中与OData一起使用join?,c#,rest,api,dynamics-crm,postman,C#,Rest,Api,Dynamics Crm,Postman,有没有办法将此代码转换为CRM Dynamics API请求 var t = (from contact in lServiceContext.CreateQuery("contact") join account in lServiceContext.CreateQuery("account") on contact["parentcustomerid"] equals account["accountid"] where contact[k

有没有办法将此代码转换为CRM Dynamics API请求

var t = (from contact in lServiceContext.CreateQuery("contact")
             join account in lServiceContext.CreateQuery("account") on contact["parentcustomerid"] equals account["accountid"]
             where contact[key].Equals(value) && contact["statuscode"].Equals(1)
             select new
             {
                 AccountID = !account.Contains("accountid") ? string.Empty : account["accountid"],
                 AccountNumber = !account.Contains("accountnumber") ? string.Empty : account["accountnumber"],
                 AccountR3 = !account.Contains("new_r3number") ? string.Empty : account["new_r3number"]
             });
嗯,我读过这篇文章,但我不太明白它是如何工作的


这样做的目的是向邮递员提出请求。

我相信这样做应该会奏效:

https://myOrg.crm.dynamics.com/api/data/v9.1/contacts?$select=contactid、fullname、\u parentcustomerid\u值和$expand=parentcustomerid\u帐户($select=accountid、accountnumber、name、new\u r3number)

在这种情况下,看起来您可以使用OData查询,但是如果遇到WebAPI的OData限制,您可以

在构建WebAPI查询时,这是必不可少的


而且,在您的原始代码中,可能值得考虑使用该方法。

谢谢,伙计。您让我对fetchXML敞开了心扉,尽管我不需要使用它,但了解这个特性真的很高兴。非常感谢。