Skip to content

YamlConfigurationExtensions Methods

ClassMethods6 members
Extension methods for adding YAML configuration sources to an Configuration.IConfigurationBuilder.
AddYamlFile(IConfigurationBuilder, string)Section titled AddYamlFile(IConfigurationBuilder, string)extensionIConfigurationBuilder
Adds the YAML configuration provider at path to builder.
public static class YamlConfigurationExtensions
{
public static IConfigurationBuilder AddYamlFile(
this IConfigurationBuilder builder,
string path)
{
// ...
}
}
builderIConfigurationBuilderThe Configuration.IConfigurationBuilder to add to.
pathstring Path relative to the base path stored in IConfigurationBuilder.Properties of builder.
IConfigurationBuilderThe Configuration.IConfigurationBuilder.
ArgumentNullExceptionbuilder is null.
ArgumentExceptionpath is null or empty.
AddYamlFile(IConfigurationBuilder, string, bool)Section titled AddYamlFile(IConfigurationBuilder, string, bool)extensionIConfigurationBuilder
Adds the YAML configuration provider at path to builder.
public static class YamlConfigurationExtensions
{
public static IConfigurationBuilder AddYamlFile(
this IConfigurationBuilder builder,
string path,
bool optional)
{
// ...
}
}
builderIConfigurationBuilderThe Configuration.IConfigurationBuilder to add to.
pathstring Path relative to the base path stored in IConfigurationBuilder.Properties of builder.
optionalboolWhether the file is optional.
IConfigurationBuilderThe Configuration.IConfigurationBuilder.
ArgumentNullExceptionbuilder is null.
ArgumentExceptionpath is null or empty.
AddYamlFile(IConfigurationBuilder, string, bool, bool)Section titled AddYamlFile(IConfigurationBuilder, string, bool, bool)extensionIConfigurationBuilder
Adds the YAML configuration provider at path to builder.
public static class YamlConfigurationExtensions
{
public static IConfigurationBuilder AddYamlFile(
this IConfigurationBuilder builder,
string path,
bool optional,
bool reloadOnChange)
{
// ...
}
}
builderIConfigurationBuilderThe Configuration.IConfigurationBuilder to add to.
pathstring Path relative to the base path stored in IConfigurationBuilder.Properties of builder.
optionalboolWhether the file is optional.
reloadOnChangeboolWhether the configuration should be reloaded if the file changes.
IConfigurationBuilderThe Configuration.IConfigurationBuilder.
ArgumentNullExceptionbuilder is null.
ArgumentExceptionpath is null or empty.
AddYamlFile(IConfigurationBuilder, IFileProvider?, string, bool, bool)Section titled AddYamlFile(IConfigurationBuilder, IFileProvider?, string, bool, bool)extensionIConfigurationBuilder
Adds a YAML configuration source to builder.
public static class YamlConfigurationExtensions
{
public static IConfigurationBuilder AddYamlFile(
this IConfigurationBuilder builder,
IFileProvider? provider,
string path,
bool optional,
bool reloadOnChange)
{
// ...
}
}
builderIConfigurationBuilderThe Configuration.IConfigurationBuilder to add to.
providerIFileProvider?The FileProviders.IFileProvider to use to access the file.
pathstring Path relative to the base path stored in IConfigurationBuilder.Properties of builder.
optionalboolWhether the file is optional.
reloadOnChangeboolWhether the configuration should be reloaded if the file changes.
IConfigurationBuilderThe Configuration.IConfigurationBuilder.
ArgumentNullExceptionbuilder is null.
ArgumentExceptionpath is null or empty.
AddYamlFile(IConfigurationBuilder, Action<YamlConfigurationSource>)Section titled AddYamlFile(IConfigurationBuilder, Action<YamlConfigurationSource>)extensionIConfigurationBuilder
Adds a YAML configuration source to builder.
public static class YamlConfigurationExtensions
{
public static IConfigurationBuilder AddYamlFile(
this IConfigurationBuilder builder,
Action<YamlConfigurationSource> configureSource)
{
// ...
}
}
builderIConfigurationBuilderThe Configuration.IConfigurationBuilder to add to.
configureSourceAction<YamlConfigurationSource>Configures the source.
IConfigurationBuilderThe Configuration.IConfigurationBuilder.
AddYamlStream(IConfigurationBuilder, Stream)Section titled AddYamlStream(IConfigurationBuilder, Stream)extensionIConfigurationBuilder
Adds a YAML configuration source to builder that reads from a IO.Stream.
public static class YamlConfigurationExtensions
{
public static IConfigurationBuilder AddYamlStream(
this IConfigurationBuilder builder,
Stream stream)
{
// ...
}
}
builderIConfigurationBuilderThe Configuration.IConfigurationBuilder to add to.
streamStreamThe IO.Stream to read the yaml configuration data from.
IConfigurationBuilderThe Configuration.IConfigurationBuilder.
ArgumentNullExceptionbuilder is null.
FormatExceptionThe YAML content in stream could not be parsed.