GetCookies-Methode hinzugefügt. Test für http-Dienst hinzugefügt

This commit is contained in:
Developer 02
2024-06-26 16:57:30 +02:00
parent 8d38e883df
commit d84ef820f1
6 changed files with 142 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ namespace DigitalData.Core.Client
return services;
}
public static IServiceCollection AddHttpClientService<TClientOptions>(this IServiceCollection services, Action<TClientOptions>? clientOptions = null, bool setAsDefault = false)
public static IServiceCollection AddHttpClientService<TClientOptions>(this IServiceCollection services, Action<TClientOptions>? clientOptions = null, bool setAsDefaultBase = false)
where TClientOptions : HttpClientOptions, new()
{
services.TryAddSingleton<HttpClient>();
@@ -25,7 +25,7 @@ namespace DigitalData.Core.Client
services.AddSingleton<IHttpClientService<TClientOptions>, HttpClientService<TClientOptions>>();
services.Configure(clientOptions ?? (_ => { }));
if (setAsDefault)
if (setAsDefaultBase)
services.AddSingleton<IBaseHttpClientService, HttpClientService<TClientOptions>>();
return services;