Skip to content

Commit bbe4881

Browse files
committed
CSharp: Add optional api constructor argument to set the basePath
1 parent 3b6ffa4 commit bbe4881

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/main/resources/csharp/api.mustache

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,23 @@
88
namespace {{package}} {
99
{{#operations}}
1010
public class {{classname}} {
11-
string basePath = "{{basePath}}";
11+
string basePath;
1212
private readonly ApiInvoker apiInvoker = ApiInvoker.GetInstance();
1313
14+
public {{classname}}(String basePath = "{{basePath}}")
15+
{
16+
this.basePath = basePath;
17+
}
18+
1419
public ApiInvoker getInvoker() {
1520
return apiInvoker;
1621
}
17-
22+
1823
// Sets the endpoint base url for the services being accessed
1924
public void setBasePath(string basePath) {
2025
this.basePath = basePath;
2126
}
22-
27+
2328
// Gets the endpoint base url for the services being accessed
2429
public String getBasePath() {
2530
return basePath;

0 commit comments

Comments
 (0)