Class HostBuilderExtensions
- Namespace
- Cuemon.Extensions.Hosting
- Assembly
- Cuemon.Extensions.Hosting.dll
Extension methods for the Microsoft.Extensions.Hosting.IHostBuilder interface.
public static class HostBuilderExtensions
- Inheritance
-
ObjectHostBuilderExtensions
Methods
ConfigureConfigurationSources(IHostBuilder, Action<IHostEnvironment, IList<IConfigurationSource>>)
Provides a way to configure the sources of the Microsoft.Extensions.Configuration.IConfigurationBuilder.
public static IHostBuilder ConfigureConfigurationSources(this IHostBuilder hostBuilder, Action<IHostEnvironment, IList<IConfigurationSource>> configureDelegate)
Parameters
hostBuilder
IHostBuilderThe Microsoft.Extensions.Hosting.IHostBuilder to extend.
configureDelegate
Action<IHostEnvironment, IList<IConfigurationSource>>The delegate for configuring the Microsoft.Extensions.Configuration.IConfigurationBuilder.Sources depending on the Microsoft.Extensions.Hosting.HostBuilderContext.HostingEnvironment.
Returns
- IHostBuilder
The same instance of the Microsoft.Extensions.Hosting.IHostBuilder for chaining.
Exceptions
- System.ArgumentNullException
hostBuilder
cannot be null -or-configureDelegate
cannot be null.
RemoveConfigurationSource(IHostBuilder, Func<IHostEnvironment, IConfigurationSource, Boolean>)
Provides a way to remove a source of the Microsoft.Extensions.Configuration.IConfigurationBuilder.
public static IHostBuilder RemoveConfigurationSource(this IHostBuilder hostBuilder, Func<IHostEnvironment, IConfigurationSource, bool> predicate)
Parameters
hostBuilder
IHostBuilderThe Microsoft.Extensions.Hosting.IHostBuilder to extend.
predicate
Func<IHostEnvironment, IConfigurationSource, Boolean>The function delegate that will determine if a source should be removed from the Microsoft.Extensions.Configuration.IConfigurationBuilder.Sources depending on the Microsoft.Extensions.Hosting.HostBuilderContext.HostingEnvironment.
Returns
- IHostBuilder
The same instance of the Microsoft.Extensions.Hosting.IHostBuilder for chaining.