From 70a3017b12b4e9648f65acea2c9ad37e383763b0 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Mon, 19 Jun 2017 12:41:43 -0700 Subject: [PATCH] Add overload that takes an IConfigurationBuilder (#1107) --- .../WebHostBuilderExtensions.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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. ///