diff --git a/RDSServiceClient/RdsServiceClientOptions.cs b/RDSServiceClient/RdsServiceClientOptions.cs deleted file mode 100644 index c3c58bb..0000000 --- a/RDSServiceClient/RdsServiceClientOptions.cs +++ /dev/null @@ -1,13 +0,0 @@ -#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. -namespace RDSServiceClient; - -public class RdsServiceClientOptions -{ - public RdsServiceClientOptions() { } - public RdsServiceClientOptions(string baseUrl) - { - BaseUrl = baseUrl; - } - - public string BaseUrl { get; set; } -} \ No newline at end of file diff --git a/RDSServiceClient/RdsSessionService.cs b/RDSServiceClient/RdsSessionService.cs index 1e2a187..c06e0a6 100644 --- a/RDSServiceClient/RdsSessionService.cs +++ b/RDSServiceClient/RdsSessionService.cs @@ -1,6 +1,4 @@ -using System.Net.Http.Headers; -using System.Net.Http.Json; -using Microsoft.Extensions.Options; +using System.Net.Http.Json; using RDSServiceLibrary; using RDSServiceLibrary.Interfaces; using RDSServiceLibrary.Models; @@ -10,14 +8,10 @@ namespace RDSServiceClient public class RdsSessionService : IRdsSessionService { private readonly HttpClient _httpClient; - private readonly IOptions _options; - public RdsSessionService(IHttpClientFactory httpClientFactory, IOptions options) + public RdsSessionService(IHttpClientFactory httpClientFactory) { - _options = options; - _httpClient = httpClientFactory.CreateClient("RdsServiceClient"); - _httpClient.BaseAddress = new Uri(options.Value.BaseUrl); - _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + _httpClient = httpClientFactory.CreateClient(); } public Task GetActiveManagementServer(string? connectionBroker = null) =>