I'm learning how to use CRM Web API with .NET Core to work with entities and I found this very useful library . There is an option to retrieve record data using 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?
You can use QueryExpressionToFetchXmlRequest
to convert the QueryExpression into FetchXml.
I have found Mike Ochs's FetchXmlWrapper helpful in certain projects.
More info: https://www.cobalt.net/2014/06/25/performance-improvements-using-fetch-xml-wrapper/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.