Skip to content

Commit

Permalink
Allow using native SQL conversion when using FetchXML feature not sup…
Browse files Browse the repository at this point in the history
…ported by serializer
  • Loading branch information
MarkMpn committed Mar 18, 2022
1 parent b33235a commit a6b9845
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion MarkMpn.Sql4Cds/PluginControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ public void OnIncomingMessage(MessageBusEventArgs message)

if (param.TryGetValue("FetchXml", out var xml) && xml is string xmlStr && !String.IsNullOrEmpty(xmlStr))
{
var fetch = DeserializeFetchXml(xmlStr);
var options = new FetchXml2SqlOptions();

if ((bool)param["ConvertOnly"])
Expand All @@ -338,11 +337,13 @@ public void OnIncomingMessage(MessageBusEventArgs message)
}
catch
{
var fetch = DeserializeFetchXml(xmlStr);
sql = FetchXml2Sql.Convert(con.ServiceClient, metadata, fetch, options, out _);
}
}
else
{
var fetch = DeserializeFetchXml(xmlStr);
sql = FetchXml2Sql.Convert(con.ServiceClient, metadata, fetch, options, out _);
}

Expand Down

0 comments on commit a6b9845

Please sign in to comment.