diff --git a/src/Microsoft.AspNetCore.Hosting/WebHostBuilderExtensions.cs b/src/Microsoft.AspNetCore.Hosting/WebHostBuilderExtensions.cs index 8427d51e77..fd094379a7 100644 --- a/src/Microsoft.AspNetCore.Hosting/WebHostBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.Hosting/WebHostBuilderExtensions.cs @@ -5,6 +5,7 @@ using System; using System.Reflection; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting.Internal; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Logging; @@ -107,6 +108,21 @@ namespace Microsoft.AspNetCore.Hosting }); } + /// + /// Adds a delegate for configuring the that will construct an . + /// + /// The to configure. + /// The delegate for configuring the that will be used to construct an . + /// The . + /// + /// The and on the are uninitialized at this stage. + /// The is pre-populated with the settings of the . + /// + public static IWebHostBuilder ConfigureAppConfiguration(this IWebHostBuilder hostBuilder, Action configureDelegate) + { + return hostBuilder.ConfigureAppConfiguration((context, builder) => configureDelegate(builder)); + } + /// /// Adds a delegate for configuring the provided . This may be called multiple times. ///