/FetchXMLToSql

Microsoft FetchXML query language converter for a select statement in SQL (For the SQL SERVER provider) / Conversor da linguagem de consulta da Microsoft FetchXML para um comando select em SQL (Para o provedor SQL SERVER)

Primary LanguageC#MIT LicenseMIT

FetchXMLToSql

Microsoft FetchXML to SQL (SQL SERVER)

string FetchXml = $@"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
                                  <entity name='contact'>
                                    <attribute name='fullname' />
                                    <attribute name='emailaddress1' />
                                    <attribute name='telephone1' />
                                    <order attribute='fullname' descending='false' />
                                    <filter type='and'>
                                      <condition attribute='address1_city' operator='eq' value='Seattle' />
                                    </filter>
                                  </entity>
                                </fetch>";

string SqlResult = FetchXMLToSql.ConvertToSQL(FetchXml);

// SELECT fullname,emailaddress1,telephone1 FROM contact WHERE (address1_city = 'Seattle') ORDER BY fullname ASC

Some operators are missing, they will be added in the next release

Feel free to to contribute :)

Installation

Nuget URL : https://www.nuget.org/packages/FetchXMLToSql/1.0.0

dotnet add package FetchXMLToSql --version 1.0.0