diff --git a/DigitalData.Core.Abstractions/Client/IHttpClientOptions.cs b/DigitalData.Core.Abstractions/Client/IHttpClientOptions.cs deleted file mode 100644 index 5600249..0000000 --- a/DigitalData.Core.Abstractions/Client/IHttpClientOptions.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace DigitalData.Core.Abstractions.Client -{ - public interface IHttpClientOptions - { - string Uri { get; init; } - - string? Path { get; init; } - - IEnumerable>? Headers { get; init; } - - IEnumerable>? QueryParams { get; init; } - } -} \ No newline at end of file diff --git a/DigitalData.Core.Abstractions/Client/IHttpClientService.cs b/DigitalData.Core.Abstractions/Client/IHttpClientService.cs index fc186ee..e94aaed 100644 --- a/DigitalData.Core.Abstractions/Client/IHttpClientService.cs +++ b/DigitalData.Core.Abstractions/Client/IHttpClientService.cs @@ -1,6 +1,6 @@ namespace DigitalData.Core.Abstractions.Client { - public interface IHttpClientService : IBaseHttpClientService where TClientOptions : IHttpClientOptions + public interface IHttpClientService : IBaseHttpClientService { } } \ No newline at end of file diff --git a/DigitalData.Core.Client/DIExtensions.cs b/DigitalData.Core.Client/DIExtensions.cs index 4ec3b4c..f67d2e4 100644 --- a/DigitalData.Core.Client/DIExtensions.cs +++ b/DigitalData.Core.Client/DIExtensions.cs @@ -8,7 +8,7 @@ namespace DigitalData.Core.Client { public static class DIExtensions { - public static IServiceCollection AddHttpClientService(this IServiceCollection services, IConfigurationSection? section) + public static IServiceCollection AddHttpClientService(this IServiceCollection services, IConfigurationSection? section = null) { services.TryAddSingleton(); services.TryAddSingleton(); diff --git a/DigitalData.Core.Client/HttpClientOptions.cs b/DigitalData.Core.Client/HttpClientOptions.cs index da859e9..d3f07f7 100644 --- a/DigitalData.Core.Client/HttpClientOptions.cs +++ b/DigitalData.Core.Client/HttpClientOptions.cs @@ -1,15 +1,13 @@ -using DigitalData.Core.Abstractions.Client; - -namespace DigitalData.Core.Client +namespace DigitalData.Core.Client { - public class HttpClientOptions : IHttpClientOptions + public class HttpClientOptions { public required string Uri { get; init; } - public string? Path { get; init; } + public string? Path { get; init; } = null; - public IEnumerable>? Headers { get; init; } + public IEnumerable>? Headers { get; init; } = null; - public IEnumerable>? QueryParams { get; init; } + public IEnumerable>? QueryParams { get; init; } = null; } } \ No newline at end of file diff --git a/DigitalData.Core.Client/ServiceFactory.cs b/DigitalData.Core.Client/ServiceFactory.cs index 7a114ec..3acefe5 100644 --- a/DigitalData.Core.Client/ServiceFactory.cs +++ b/DigitalData.Core.Client/ServiceFactory.cs @@ -19,7 +19,7 @@ namespace DigitalData.Core.Client public static T Provide() where T : notnull => _lazyProvider.Value.GetRequiredService(); - public static IHttpClientService ProvideHttpClientService() where TOptions : IHttpClientOptions + public static IHttpClientService ProvideHttpClientService() => _lazyProvider.Value.GetRequiredService>(); } } \ No newline at end of file