Add public base URL to LC client

pull/33/head
Pat Hartl 2023-11-16 01:44:35 -06:00
parent 839e9b4935
commit 26f03f61fc
1 changed files with 11 additions and 5 deletions

View File

@ -18,18 +18,24 @@ namespace LANCommander.SDK
private readonly ILogger Logger;
private readonly RestClient ApiClient;
private AuthToken Token;
private AuthToken Token;
public string BaseUrl;
public Client(string baseUrl)
{
if (!String.IsNullOrWhiteSpace(baseUrl))
ApiClient = new RestClient(baseUrl);
BaseUrl = baseUrl;
if (!String.IsNullOrWhiteSpace(BaseUrl))
ApiClient = new RestClient(BaseUrl);
}
public Client(string baseUrl, ILogger logger)
{
if (!String.IsNullOrWhiteSpace(baseUrl))
ApiClient = new RestClient(baseUrl);
BaseUrl = baseUrl;
if (!String.IsNullOrWhiteSpace(BaseUrl))
ApiClient = new RestClient(BaseUrl);
Logger = logger;
}