Microsoft.Extensions.Configuration.Abstractions 10.0.0-preview.5.25277.114
About
Provides abstractions of key-value pair based configuration. Interfaces defined in this package are implemented by classes in Microsoft.Extensions.Configuration and other configuration packages.
Key Features
- Abstractions for string key-value pair configuration sources and sections
- Path conventions of keys establishing a heirachy of values
- Support for multiple configuration sources, aggregating and defining precdence for values
- Support for reload on change
How to Use
The example below shows a small code sample using this library and trying out the ConfigurationKeyName attribute available since .NET 6:
public class MyClass
{
[ConfigurationKeyName("named_property")]
public string NamedProperty { get; set; }
}
Given the simple class above, we can create a dictionary to hold the configuration data and use it as the memory source to build a configuration section:
var dic = new Dictionary<string, string>
{
{"named_property", "value for named property"},
};
var config = new ConfigurationBuilder()
.AddInMemoryCollection(dic)
.Build();
var options = config.Get<MyClass>();
Console.WriteLine(options.NamedProperty); // returns "value for named property"
Main Types
The main types provided by this library are:
Microsoft.Extensions.Configuration.IConfigurationMicrosoft.Extensions.Configuration.IConfigurationBuilderMicrosoft.Extensions.Configuration.IConfigurationProviderMicrosoft.Extensions.Configuration.IConfigurationRootMicrosoft.Extensions.Configuration.IConfigurationSection
Additional Documentation
Related Packages
- Microsoft.Extensions.Configuration
- Microsoft.Extensions.Configuration.Binder
- Microsoft.Extensions.Configuration.CommandLine
- Microsoft.Extensions.Configuration.EnvironmentVariables
- Microsoft.Extensions.Configuration.FileExtensions
- Microsoft.Extensions.Configuration.Ini
- Microsoft.Extensions.Configuration.Json
- Microsoft.Extensions.Configuration.UserSecrets
- Microsoft.Extensions.Configuration.Xml
Feedback & Contributing
Microsoft.Extensions.Caching.Abstractions is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
Showing the top 20 packages that depend on Microsoft.Extensions.Configuration.Abstractions.
| Packages | Downloads |
|---|---|
|
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
|
8 |
|
Microsoft.Extensions.Configuration
Implementation of key-value pair based configuration for Microsoft.Extensions.Configuration. Includes the memory configuration provider.
When using NuGet 3.x this package requires at least version 3.4.
|
8 |
|
Microsoft.Extensions.Configuration.EnvironmentVariables
Environment variables configuration provider implementation for Microsoft.Extensions.Configuration.
|
7 |
|
Microsoft.Extensions.Configuration.Binder
Provides the functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration. This package enables you to represent the configuration data as strongly-typed classes defined in the application code. To bind a configuration, use the Microsoft.Extensions.Configuration.ConfigurationBinder.Get extension method on the IConfiguration object. To use this package, you also need to install a package for the configuration provider, for example, Microsoft.Extensions.Configuration.Json for the JSON provider.
|
7 |
|
Microsoft.Extensions.Configuration.Binder
Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.
|
7 |
|
Microsoft.Extensions.Configuration.Binder
Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.
When using NuGet 3.x this package requires at least version 3.4.
|
7 |
|
Microsoft.Extensions.Configuration.EnvironmentVariables
Environment variables configuration provider implementation for Microsoft.Extensions.Configuration. This package enables you to read configuration parameters from environment variables. You can use EnvironmentVariablesExtensions.AddEnvironmentVariables extension method on IConfigurationBuilder to add the environment variables configuration provider to the configuration builder.
|
7 |
|
Microsoft.EntityFrameworkCore.Relational
Shared Entity Framework Core components for relational database providers.
|
7 |
.NET Framework 4.6.2
- Microsoft.Extensions.Primitives (>= 10.0.0-preview.5.25277.114)
- System.ValueTuple (>= 4.6.1)
.NET 8.0
- Microsoft.Extensions.Primitives (>= 10.0.0-preview.5.25277.114)
.NET 9.0
- Microsoft.Extensions.Primitives (>= 10.0.0-preview.5.25277.114)
.NET 10.0
- Microsoft.Extensions.Primitives (>= 10.0.0-preview.5.25277.114)
.NET Standard 2.0
- Microsoft.Extensions.Primitives (>= 10.0.0-preview.5.25277.114)