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