【问题标题】:FetchXML in .NET Core - CRM Web API.NET Core 中的 FetchXML - CRM Web API
【发布时间】:2019-10-08 12:10:53
【问题描述】:

我正在学习如何将 CRM Web API 与 .NET Core 一起使用来处理实体,我发现这非常有用 library。可以选择使用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 });

是否有任何选项可以让fetchXML 更轻松、更优雅地编写,例如使用 QueryExpression (Microsoft.CrmSdk.CoreAssemblies) 或类似方法?

【问题讨论】:

  • 你最后得到了什么?
  • 不是,我使用 XrmToolBox FetchXML,虽然它不是我想要的。

标签: c# asp.net-core .net-core dynamics-crm


【解决方案1】:
  1. 设计高级查找查询并下载 fetchxml
  2. 使用 XrmToolBox FetchXML builder 开发 fetchxml 查询

您可以使用QueryExpressionToFetchXmlRequest 将QueryExpression 转换为FetchXml。

Read more

【讨论】:

  • QueryExpressionToFetchXmlRequest 会很好,但我不能在 .NET Core 中使用 IOrganizationService 所以我不知道如何在那里使用它以及是否可能。
【解决方案2】:

我发现 Mike Ochs 的 FetchXmlWrapper 在某些项目中很有帮助。

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

【讨论】:

    猜你喜欢
    • 2018-05-08
    • 1970-01-01
    • 1970-01-01
    • 2021-04-19
    • 2019-03-16
    • 1970-01-01
    • 2018-01-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多