Skip to content

Commit

Permalink
Update CSharpClientGenerator.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
barnuri authored Aug 15, 2024
1 parent 1fe6839 commit fb9bcea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/generators/client/CSharpClientGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ ${controllerPropsCtor}
: ``;
let queryContent = ``;
if (haveQueryParams) {
queryContent += `\t\tvar query = new List<string>();`;
queryContent += `\t\tvar query = new List<string>();\n`;
for (const queryParam of controllerPath.queryParams) {
const csharpParam = `q${capitalize(queryParam.name)}`;
const isList = this.getPropDesc(queryParam.schema!).includes('[]');
if (isList) {
queryContent = `\t\tif (${csharpParam} != null) { query.AddRange(${csharpParam}.Select(x => $"${queryParam.name}={x}")); }`
queryContent += `\t\tif (${csharpParam} != null) { query.AddRange(${csharpParam}.Select(x => $"${queryParam.name}={x}")); }\n`
} else {
queryContent = `\t\tquery.Add($"${queryParam.name}={${csharpParam}}");`
queryContent += `\t\tquery.Add($"${queryParam.name}={${csharpParam}}");\n`
}
}
}
Expand Down

0 comments on commit fb9bcea

Please sign in to comment.