diff --git a/src/Leanetec.EConnect.Infrastructure/EConnectClient.cs b/src/Leanetec.EConnect.Infrastructure/EConnectClient.cs index 96a69be..470c786 100644 --- a/src/Leanetec.EConnect.Infrastructure/EConnectClient.cs +++ b/src/Leanetec.EConnect.Infrastructure/EConnectClient.cs @@ -1,17 +1,21 @@ using Leanetec.EConnect.Client.Interface; using Leanetec.EConnect.Domain.Entities; +using Microsoft.Extensions.Options; using System.Net.Http.Json; namespace Leanetec.EConnect.Infrastructure; public class EConnectClient : IEConnectClient where TError : class { + private readonly EConnectClientOptions _options; + private readonly Lazy LazyHttp; private HttpClient Http => LazyHttp.Value; - public EConnectClient(IHttpClientFactory httpFactory) + public EConnectClient(IOptions options, IHttpClientFactory httpFactory) { + _options = options.Value; LazyHttp = new Lazy(httpFactory.CreateEConnectClient); } diff --git a/src/Leanetec.EConnect.Infrastructure/EConnectClientOptions.cs b/src/Leanetec.EConnect.Infrastructure/EConnectClientOptions.cs new file mode 100644 index 0000000..8ade01c --- /dev/null +++ b/src/Leanetec.EConnect.Infrastructure/EConnectClientOptions.cs @@ -0,0 +1,6 @@ +namespace Leanetec.EConnect.Infrastructure; + +public class EConnectClientOptions +{ + public string? ApiKey { get; set; } +}