Skip to content

Commit

Permalink
Refactor parameter in AddElsaClient method
Browse files Browse the repository at this point in the history
The parameter "configureOptions" in the AddElsaClient method has been renamed and refactored to allow direct HTTP client configuration. This change enables the actions for configuring the HTTP client to be passed directly, providing greater flexibility for customization.
  • Loading branch information
sfmskywalker committed Dec 29, 2023
1 parent 36791a5 commit dc223bc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ public static class DependencyInjectionExtensions
/// <param name="services">The service collection.</param>
/// <param name="baseAddress">The base address of the Elsa API.</param>
/// <param name="apiKey">The API key to use for authentication.</param>
/// <param name="configureOptions">An optional delegate that can be used to configure the client options.</param>
/// <param name="configureHttpClient">An optional delegate that can be used to configure the HTTP client.</param>
/// <param name="configureBuilderOptions">An optional delegate that can be used to configure the client builder options.</param>
public static IServiceCollection AddElsaClient(this IServiceCollection services, Uri baseAddress, string apiKey, Action<ElsaClientOptions>? configureOptions = default, Action<ElsaClientBuilderOptions>? configureBuilderOptions = default)
public static IServiceCollection AddElsaClient(this IServiceCollection services, Uri baseAddress, string apiKey, Action<IServiceProvider, HttpClient>? configureHttpClient = default, Action<ElsaClientBuilderOptions>? configureBuilderOptions = default)
{
services.AddScoped<ApiKeyHttpMessageHandler>();
return services.AddElsaClient(
options =>
{
options.BaseAddress = baseAddress;
options.ApiKey = apiKey;
configureOptions?.Invoke(options);
options.ConfigureHttpClient = configureHttpClient;
},
configureBuilderOptions: options =>
{
Expand Down

0 comments on commit dc223bc

Please sign in to comment.