You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The URL GetDashboardChart?stateAbbr=&varNames=VAR1&varNames=VAR2 should result in a valid query to this method. However, there is no support for this in Action.Url. I have written a custom function to handle this case:
publicstaticstringGetArrayQueryParams(IMethodmethod){vararrayParameters=newList<string>();foreach(var parameter in method.Parameters){if(parameter.Type.IsCollection &&!parameter.HasAttribute("FromBody")){
arrayParameters.Add($"${{{parameter.Name}.map(item => `{parameter.Name}=${{item}}`).join('&')}}");}}return arrayParameters.Any()?$"&{string.Join("&", arrayParameters)}":string.Empty;}
I have an API method with the following signature:
The URL
GetDashboardChart?stateAbbr=&varNames=VAR1&varNames=VAR2
should result in a valid query to this method. However, there is no support for this inAction.Url
. I have written a custom function to handle this case:Which results in the following TypeScript:
This works, but it would be better if this were built-in functionality.
The text was updated successfully, but these errors were encountered: