简体   繁体   English

.NET 核心中的 FetchXML - CRM Web API

[英]FetchXML in .NET Core - CRM Web API

I'm learning how to use CRM Web API with .NET Core to work with entities and I found this very useful library .我正在学习如何使用 CRM Web API 和 .NET Core 来处理实体,我发现这个非常有用的 There is an option to retrieve record data using FetchXML .有一个使用FetchXML检索记录数据的选项。

string fetchXml = "<fetch mapping='logical'><entity name='account'><attribute name='accountid'/><attribute name='name'/></entity></fetch>";
var fetchResults = await api.GetList("accounts", QueryOptions: new CRMGetListOptions() { FetchXml = fetchXml });

Is there any option how to compose more easily and elegantly the fetchXML , for example by using QueryExpression ( Microsoft.CrmSdk.CoreAssemblies ) or something similar?是否有任何选项可以更轻松、更优雅地fetchXML ,例如使用 QueryExpression ( Microsoft.CrmSdk.CoreAssemblies )或类似的东西?

  1. Design the Advanced find query & download the fetchxml设计高级查找查询并下载 fetchxml
  2. Develop fetchxml queries using XrmToolBox FetchXML builder使用XrmToolBox FetchXML builder开发 fetchxml 查询

You can use QueryExpressionToFetchXmlRequest to convert the QueryExpression into FetchXml.您可以使用QueryExpressionToFetchXmlRequest将 QueryExpression 转换为 FetchXml。

Read more阅读更多

I have found Mike Ochs's FetchXmlWrapper helpful in certain projects.我发现 Mike Ochs 的FetchXmlWrapper在某些项目中很有帮助。

More info: https://www.cobalt.net/2014/06/25/performance-improvements-using-fetch-xml-wrapper/更多信息: https://www.cobalt.net/2014/06/25/performance-improvements-using-fetch-xml-wrapper/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM