Exemplo n.º 1
0
 public QcProjectService(IHttpClientFactory _httpClientFactory
                         , IQcProjectSdkHook QcProjectSdkHook
                         )
 {
     _sdkHook   = QcProjectSdkHook;
     _apiConfig = QcProjectSdkHook.GetConfig();
     if (_apiConfig == null)
     {
         throw new Exception("QcProject not configured");
     }
     _httpClient = _httpClientFactory.CreateClient("QcProject");
     if (!string.IsNullOrWhiteSpace(_apiConfig.ApiUrl))
     {
         _httpClient.BaseAddress = new Uri(_apiConfig.ApiUrl);
     }
     _httpClient.BaseAddress = new Uri(_apiConfig.ApiUrl);
     if (_apiConfig.Timeout.HasValue)
     {
         _httpClient.Timeout = TimeSpan.FromSeconds(_apiConfig.Timeout.Value);
     }
 }
 public DefaultQcProjectSdkHook(IOptions <QcProjectConfig> options)
 {
     _apiConfig = options.Value;
 }