Skip to content

Commit

Permalink
add overload of ConfigureFunctionsWebApplication allowing to pass Hos…
Browse files Browse the repository at this point in the history
…tBuilderContext in configure action
  • Loading branch information
vmcbaptista authored and fabiocav committed Oct 17, 2023
1 parent a821a73 commit a8ed46b
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,25 @@ public static IHostBuilder ConfigureFunctionsWebApplication(this IHostBuilder bu
/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns>
public static IHostBuilder ConfigureFunctionsWebApplication(this IHostBuilder builder, Action<IFunctionsWorkerApplicationBuilder> configureWorker)
{
builder.ConfigureFunctionsWorkerDefaults(workerAppBuilder =>
return builder.ConfigureFunctionsWebApplication((_, workerAppBuilder) =>
{
workerAppBuilder.UseAspNetCoreIntegration();
configureWorker?.Invoke(workerAppBuilder);
});
}

/// <summary>
/// Configures the worker to use the ASP.NET Core integration, enabling advanced HTTP features.
/// </summary>
/// <param name="builder">The <see cref="IHostBuilder"/> to configure.</param>
/// <param name="configureWorker">The worker configure callback.</param>
/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns>
public static IHostBuilder ConfigureFunctionsWebApplication(this IHostBuilder builder, Action<HostBuilderContext, IFunctionsWorkerApplicationBuilder> configureWorker)
{
builder.ConfigureFunctionsWorkerDefaults((hostBuilderContext, workerAppBuilder) =>
{
workerAppBuilder.UseAspNetCoreIntegration();
configureWorker?.Invoke(hostBuilderContext, workerAppBuilder);
});

builder.ConfigureAspNetCoreIntegration();

Expand Down

0 comments on commit a8ed46b

Please sign in to comment.