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) { // ... }}Parameters
builderIConfigurationBuilder The Configuration.IConfigurationBuilder to add to.pathstring Path relative to the base path stored in IConfigurationBuilder.Properties of builder. Returns
IConfigurationBuilder The Configuration.IConfigurationBuilder .Exceptions
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) { // ... }}Parameters
builderIConfigurationBuilder The Configuration.IConfigurationBuilder to add to.pathstring Path relative to the base path stored in IConfigurationBuilder.Properties of builder. optionalboolWhether the file is optional.Returns
IConfigurationBuilder The Configuration.IConfigurationBuilder .Exceptions
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) { // ... }}Parameters
builderIConfigurationBuilder The Configuration.IConfigurationBuilder to add to.pathstring Path relative to the base path stored in IConfigurationBuilder.Properties of builder. optionalboolWhether the file is optional.reloadOnChange boolWhether the configuration should be reloaded if the file changes.Returns
IConfigurationBuilder The Configuration.IConfigurationBuilder .Exceptions
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) { // ... }}Parameters
builderIConfigurationBuilder The 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.reloadOnChange boolWhether the configuration should be reloaded if the file changes.Returns
IConfigurationBuilder The Configuration.IConfigurationBuilder .Exceptions
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) { // ... }}Parameters
builderIConfigurationBuilder The Configuration.IConfigurationBuilder to add to.configureSource Action<YamlConfigurationSource> Configures the source.Returns
IConfigurationBuilder The 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) { // ... }}Parameters
builderIConfigurationBuilder The Configuration.IConfigurationBuilder to add to.streamStreamThe IO.Stream to read the yaml configuration data from.Returns
IConfigurationBuilder The Configuration.IConfigurationBuilder .Exceptions
ArgumentNullExceptionbuilder is null.FormatExceptionThe YAML content in stream could not be parsed.