From a8ed46be24b7c3b6fcbed5de05c7e79f889a49e0 Mon Sep 17 00:00:00 2001 From: vmcbaptista Date: Sat, 23 Sep 2023 16:19:07 +0100 Subject: [PATCH] add overload of ConfigureFunctionsWebApplication allowing to pass HostBuilderContext in configure action --- .../src/FunctionsHostBuilderExtensions.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/extensions/Worker.Extensions.Http.AspNetCore/src/FunctionsHostBuilderExtensions.cs b/extensions/Worker.Extensions.Http.AspNetCore/src/FunctionsHostBuilderExtensions.cs index 5df1b4fad..91ac96221 100644 --- a/extensions/Worker.Extensions.Http.AspNetCore/src/FunctionsHostBuilderExtensions.cs +++ b/extensions/Worker.Extensions.Http.AspNetCore/src/FunctionsHostBuilderExtensions.cs @@ -34,11 +34,25 @@ public static IHostBuilder ConfigureFunctionsWebApplication(this IHostBuilder bu /// The same instance of the for chaining. public static IHostBuilder ConfigureFunctionsWebApplication(this IHostBuilder builder, Action configureWorker) { - builder.ConfigureFunctionsWorkerDefaults(workerAppBuilder => + return builder.ConfigureFunctionsWebApplication((_, workerAppBuilder) => { - workerAppBuilder.UseAspNetCoreIntegration(); configureWorker?.Invoke(workerAppBuilder); }); + } + + /// + /// Configures the worker to use the ASP.NET Core integration, enabling advanced HTTP features. + /// + /// The to configure. + /// The worker configure callback. + /// The same instance of the for chaining. + public static IHostBuilder ConfigureFunctionsWebApplication(this IHostBuilder builder, Action configureWorker) + { + builder.ConfigureFunctionsWorkerDefaults((hostBuilderContext, workerAppBuilder) => + { + workerAppBuilder.UseAspNetCoreIntegration(); + configureWorker?.Invoke(hostBuilderContext, workerAppBuilder); + }); builder.ConfigureAspNetCoreIntegration();