Skip to content

Commit

Permalink
FetchXML supports indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rappen committed Jan 14, 2023
1 parent 2a93973 commit 21c283e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions FetchXmlBuilder/Converters/CSharpCodeGeneratorFetchXML.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,15 @@ public static string GetCSharpFetchXMLCode(string fetchXml, CodeGenerators codes

cs += "var fetchXml = $@\"" + sb.Replace("\"", "\"\"").ToString() + "\";";

cs = string.Join("\n", cs.Split('\n').Select(l => Indent(codesettings.Indents) + l));
return cs;
}

private static string Indent(int indents = 1)
{
return string.Concat(Enumerable.Repeat(" ", indents));
}

private static string AddData(string attribute, string value, Dictionary<string, string> data)
{
var key = attribute;
Expand Down

0 comments on commit 21c283e

Please sign in to comment.