Add overload that takes an IConfigurationBuilder (#1107)
This commit is contained in:
parent
39aa81abcc
commit
70a3017b12
|
|
@ -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
|
|||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a delegate for configuring the <see cref="IConfigurationBuilder"/> that will construct an <see cref="IConfiguration"/>.
|
||||
/// </summary>
|
||||
/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param>
|
||||
/// <param name="configureDelegate">The delegate for configuring the <see cref="IConfigurationBuilder" /> that will be used to construct an <see cref="IConfiguration" />.</param>
|
||||
/// <returns>The <see cref="IWebHostBuilder"/>.</returns>
|
||||
/// <remarks>
|
||||
/// The <see cref="IConfiguration"/> and <see cref="ILoggerFactory"/> on the <see cref="WebHostBuilderContext"/> are uninitialized at this stage.
|
||||
/// The <see cref="IConfigurationBuilder"/> is pre-populated with the settings of the <see cref="IWebHostBuilder"/>.
|
||||
/// </remarks>
|
||||
public static IWebHostBuilder ConfigureAppConfiguration(this IWebHostBuilder hostBuilder, Action<IConfigurationBuilder> configureDelegate)
|
||||
{
|
||||
return hostBuilder.ConfigureAppConfiguration((context, builder) => configureDelegate(builder));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a delegate for configuring the provided <see cref="LoggerFactory"/>. This may be called multiple times.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue