mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 10:58:55 +00:00
CSharp: Add optional api constructor argument to set the basePath
This commit is contained in:
parent
3b6ffa4a1f
commit
bbe48814b4
@ -8,18 +8,23 @@
|
||||
namespace {{package}} {
|
||||
{{#operations}}
|
||||
public class {{classname}} {
|
||||
string basePath = "{{basePath}}";
|
||||
string basePath;
|
||||
private readonly ApiInvoker apiInvoker = ApiInvoker.GetInstance();
|
||||
|
||||
public {{classname}}(String basePath = "{{basePath}}")
|
||||
{
|
||||
this.basePath = basePath;
|
||||
}
|
||||
|
||||
public ApiInvoker getInvoker() {
|
||||
return apiInvoker;
|
||||
}
|
||||
|
||||
|
||||
// Sets the endpoint base url for the services being accessed
|
||||
public void setBasePath(string basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
|
||||
|
||||
// Gets the endpoint base url for the services being accessed
|
||||
public String getBasePath() {
|
||||
return basePath;
|
||||
|
Loading…
Reference in New Issue
Block a user