Skip to content

Commit

Permalink
Added QueryByAttribute style
Browse files Browse the repository at this point in the history
  • Loading branch information
rappen committed Jan 18, 2023
1 parent 09dbccb commit 408e44e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions FetchXmlBuilder/Converters/CSharpCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public static string GetCSharpQueryExpression(QueryExpression QEx, List<EntityMe
{
throw new ArgumentOutOfRangeException("Style & Flavor", $"Combo is not possible.");
}
if (settings.CodeGenerators.QExStyle == QExStyleEnum.QueryByAttribute)
{
throw new ArgumentException("Sorry, not yet implemented", "Style");
}

var coder = new CSharpCodeGenerator(QEx, entities, settings);
var result = coder.GetQueryCode();
Expand Down Expand Up @@ -1129,6 +1133,13 @@ internal static QExStyle[] GetComboBoxItems()
ClassName = "Microsoft.CrmSdk.CoreAssemblies",
HelpUrl = "https://learn.microsoft.com/en-us/power-apps/developer/data-platform/org-service/samples/retrieve-multiple-queryexpression-class",
},
new QExStyle
{
Tag = QExStyleEnum.QueryByAttribute,
Creator = "Microsoft",
ClassName = "Microsoft.CrmSdk.CoreAssemblies",
HelpUrl = "https://learn.microsoft.com/en-us/power-apps/developer/data-platform/org-service/samples/retrieve-multiple-querybyattribute-class",
},
//new QExStyle
//{
// Tag = QExStyleEnum.OrganizationServiceContext,
Expand Down
1 change: 1 addition & 0 deletions FetchXmlBuilder/FetchXmlBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ internal string GetQueryExpressionCode()
return CSharpCodeGeneratorFetchXML.GetCSharpFetchXMLCode(fetch, settings.CodeGenerators);

case QExStyleEnum.QueryExpression:
case QExStyleEnum.QueryByAttribute:
case QExStyleEnum.OrganizationServiceContext:
case QExStyleEnum.QueryExpressionFactory:
case QExStyleEnum.FluentQueryExpression:
Expand Down
1 change: 1 addition & 0 deletions FetchXmlBuilder/Settings/FXBSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ public class CodeGenerators
public enum QExStyleEnum
{
QueryExpression,
QueryByAttribute,
OrganizationServiceContext,
QueryExpressionFactory,
FluentQueryExpression,
Expand Down

0 comments on commit 408e44e

Please sign in to comment.