Skip to content

Commit

Permalink
Replace collection length checks for compatibility (#4904)
Browse files Browse the repository at this point in the history
  • Loading branch information
jake-carpenter authored Jun 12, 2024
1 parent 9d67c72 commit 413c17c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{% if parameter.IsDateTimeArray -%}
for (var i = 0; i < {{ parameter.VariableName }}.Length; i++)
for (var i = 0; i < {{ parameter.VariableName }}.Count(); i++)
{
if (i > 0) urlBuilder_.Append(',');
urlBuilder_.Append(System.Uri.EscapeDataString({{ parameter.VariableName }}[i].ToString("{{ ParameterDateTimeFormat }}", System.Globalization.CultureInfo.InvariantCulture)));
}
{% elsif parameter.IsDateArray -%}
for (var i = 0; i < {{ parameter.VariableName }}.Length; i++)
for (var i = 0; i < {{ parameter.VariableName }}.Count(); i++)
{
if (i > 0) urlBuilder_.Append(',');
urlBuilder_.Append(System.Uri.EscapeDataString({{ parameter.VariableName }}[i].ToString("{{ ParameterDateFormat }}", System.Globalization.CultureInfo.InvariantCulture)));
Expand All @@ -15,11 +15,11 @@ urlBuilder_.Append(System.Uri.EscapeDataString({{ parameter.VariableName }}.ToSt
{% elsif parameter.IsDate -%}
urlBuilder_.Append(System.Uri.EscapeDataString({{ parameter.VariableName }}.ToString("{{ ParameterDateFormat }}", System.Globalization.CultureInfo.InvariantCulture)));
{% elsif parameter.IsArray -%}
for (var i = 0; i < {{ parameter.VariableName }}.Length; i++)
for (var i = 0; i < {{ parameter.VariableName }}.Count(); i++)
{
if (i > 0) urlBuilder_.Append(',');
urlBuilder_.Append(ConvertToString({{ parameter.VariableName }}[i], System.Globalization.CultureInfo.InvariantCulture));
urlBuilder_.Append(ConvertToString({{ parameter.VariableName }}.ElementAt(i), System.Globalization.CultureInfo.InvariantCulture));
}
{% else -%}
urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString({{ parameter.VariableName }}, System.Globalization.CultureInfo.InvariantCulture)));
{%- endif %}
{%- endif %}

0 comments on commit 413c17c

Please sign in to comment.