From 55f3b51b9dbdd025c89b112452bea83f539e3dec Mon Sep 17 00:00:00 2001
From: "MSDN.WhiteKnight" <35516665+MSDN-WhiteKnight@users.noreply.github.com>
Date: Sun, 30 Oct 2022 18:21:27 +0500
Subject: [PATCH 1/4] Add package readme for
Microsoft.Extensions.Configuration.Binder
---
...oft.Extensions.Configuration.Binder.csproj | 4 +-
.../src/README.md | 87 +++++++++++++++++++
2 files changed, 90 insertions(+), 1 deletion(-)
create mode 100644 src/libraries/Microsoft.Extensions.Configuration.Binder/src/README.md
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj b/src/libraries/Microsoft.Extensions.Configuration.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj
index f5517f57f23c6..8685d82ac87cc 100644
--- a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj
+++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj
@@ -5,13 +5,15 @@
true
true
true
- Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration.
+ 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.
+ README.md
+
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/README.md b/src/libraries/Microsoft.Extensions.Configuration.Binder/src/README.md
new file mode 100644
index 0000000000000..db0c73f1e9541
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/src/README.md
@@ -0,0 +1,87 @@
+## About
+
+Provides the functionality to bind an object to data in configuration providers for [Microsoft.Extensions.Configuration](https://www.nuget.org/packages/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](https://learn.microsoft.com/dotnet/api/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](https://learn.microsoft.com/dotnet/core/extensions/configuration#configuration-providers), for example, [Microsoft.Extensions.Configuration.Json](https://www.nuget.org/packages/Microsoft.Extensions.Configuration.Json/) for the JSON provider.
+
+For more information, see the documentation:
+
+- [Configuration in .NET](https://learn.microsoft.com/dotnet/core/extensions/configuration)
+- [Microsoft.Extensions.Configuration.ConfigurationBinder](https://learn.microsoft.com/dotnet/api/microsoft.extensions.configuration.configurationbinder)
+
+## Example
+
+The following example shows how to bind a JSON configuration section to .NET objects.
+
+```cs
+using System;
+using Microsoft.Extensions.Configuration;
+
+class Settings
+{
+ public string Server { get; set; }
+ public string Database { get; set; }
+ public Endpoint[] Endpoints { get; set; }
+}
+
+class Endpoint
+{
+ public string IPAddress { get; set; }
+ public int Port { get; set; }
+}
+
+class Program
+{
+ static void Main()
+ {
+ // Build a configuration object from JSON file
+ IConfiguration config = new ConfigurationBuilder()
+ .AddJsonFile("appsettings.json")
+ .Build();
+
+ // Bind a configuration section to an instance of Settings class
+ Settings settings = config.GetSection("Settings").Get();
+
+ // Read simple values
+ Console.WriteLine($"Server: {settings.Server}");
+ Console.WriteLine($"Database: {settings.Database}");
+
+ // Read nested objects
+ Console.WriteLine("Endpoints: ");
+
+ foreach (Endpoint endpoint in settings.Endpoints)
+ {
+ Console.WriteLine($"{endpoint.IPAddress}:{endpoint.Port}");
+ }
+ }
+}
+```
+
+To run this example, include an `appsettings.json` file with the following content in your project:
+
+```json
+{
+ "Settings": {
+ "Server": "example.com",
+ "Database": "Northwind",
+ "Endpoints": [
+ {
+ "IPAddress": "192.168.0.1",
+ "Port": "80"
+ },
+ {
+ "IPAddress": "192.168.10.1",
+ "Port": "8080"
+ }
+ ]
+ }
+}
+```
+
+You can include a configuration file using a code like this in your `.csproj` file:
+
+```xml
+
+
+ Always
+
+
+```
From 2796c3684b6a145ecda3377678b1f3c410b61012 Mon Sep 17 00:00:00 2001
From: "MSDN.WhiteKnight" <35516665+MSDN-WhiteKnight@users.noreply.github.com>
Date: Sun, 30 Oct 2022 22:58:43 +0500
Subject: [PATCH 2/4] Update README.md
---
.../src/README.md | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/README.md b/src/libraries/Microsoft.Extensions.Configuration.Binder/src/README.md
index db0c73f1e9541..3a8b36e5ed6c2 100644
--- a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/README.md
+++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/src/README.md
@@ -1,14 +1,18 @@
-## About
+# Microsoft.Extensions.Configuration.Binder
Provides the functionality to bind an object to data in configuration providers for [Microsoft.Extensions.Configuration](https://www.nuget.org/packages/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](https://learn.microsoft.com/dotnet/api/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](https://learn.microsoft.com/dotnet/core/extensions/configuration#configuration-providers), for example, [Microsoft.Extensions.Configuration.Json](https://www.nuget.org/packages/Microsoft.Extensions.Configuration.Json/) for the JSON provider.
-For more information, see the documentation:
+Documentation can be found at https://learn.microsoft.com/dotnet/core/extensions/configuration
-- [Configuration in .NET](https://learn.microsoft.com/dotnet/core/extensions/configuration)
-- [Microsoft.Extensions.Configuration.ConfigurationBinder](https://learn.microsoft.com/dotnet/api/microsoft.extensions.configuration.configurationbinder)
+## Contribution Bar
+- [x] [We consider new features, new APIs, bug fixes, and performance changes](../../../libraries/README.md#primary-bar)
-## Example
+The APIs and functionality are mature, but do get extended occasionally.
+
+## Deployment
+[Microsoft.Extensions.Configuration.Binder](https://www.nuget.org/packages/Microsoft.Extensions.Configuration.Binder/) is not included in the shared framework. The package is deployed as out-of-band (OOB) and needs to be installed into projects directly.
+## Example
The following example shows how to bind a JSON configuration section to .NET objects.
```cs
From 72c8692fc9592a5fad7ea2d5bbcf15d0600898a4 Mon Sep 17 00:00:00 2001
From: "MSDN.WhiteKnight" <35516665+MSDN-WhiteKnight@users.noreply.github.com>
Date: Sun, 30 Oct 2022 23:12:25 +0500
Subject: [PATCH 3/4] Move Readme
---
.../{src => }/README.md | 2 +-
.../src/Microsoft.Extensions.Configuration.Binder.csproj | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
rename src/libraries/Microsoft.Extensions.Configuration.Binder/{src => }/README.md (98%)
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/README.md b/src/libraries/Microsoft.Extensions.Configuration.Binder/README.md
similarity index 98%
rename from src/libraries/Microsoft.Extensions.Configuration.Binder/src/README.md
rename to src/libraries/Microsoft.Extensions.Configuration.Binder/README.md
index 3a8b36e5ed6c2..eaf1bf52a5b48 100644
--- a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/README.md
+++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/README.md
@@ -5,7 +5,7 @@ Provides the functionality to bind an object to data in configuration providers
Documentation can be found at https://learn.microsoft.com/dotnet/core/extensions/configuration
## Contribution Bar
-- [x] [We consider new features, new APIs, bug fixes, and performance changes](../../../libraries/README.md#primary-bar)
+- [x] [We consider new features, new APIs, bug fixes, and performance changes](../../libraries/README.md#primary-bar)
The APIs and functionality are mature, but do get extended occasionally.
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj b/src/libraries/Microsoft.Extensions.Configuration.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj
index 8685d82ac87cc..5cc70b4332628 100644
--- a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj
+++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj
@@ -13,7 +13,7 @@
-
+
From 35a1b1322a2300f5c48596e391fd414ee4e1b09a Mon Sep 17 00:00:00 2001
From: "MSDN.WhiteKnight" <35516665+MSDN-WhiteKnight@users.noreply.github.com>
Date: Sun, 30 Oct 2022 23:24:31 +0500
Subject: [PATCH 4/4] Update deployment section
---
.../Microsoft.Extensions.Configuration.Binder/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/README.md b/src/libraries/Microsoft.Extensions.Configuration.Binder/README.md
index eaf1bf52a5b48..3bd8e9baab932 100644
--- a/src/libraries/Microsoft.Extensions.Configuration.Binder/README.md
+++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/README.md
@@ -10,7 +10,7 @@ Documentation can be found at https://learn.microsoft.com/dotnet/core/extensions
The APIs and functionality are mature, but do get extended occasionally.
## Deployment
-[Microsoft.Extensions.Configuration.Binder](https://www.nuget.org/packages/Microsoft.Extensions.Configuration.Binder/) is not included in the shared framework. The package is deployed as out-of-band (OOB) and needs to be installed into projects directly.
+[Microsoft.Extensions.Configuration.Binder](https://www.nuget.org/packages/Microsoft.Extensions.Configuration.Binder/) is included in the ASP.NET Core shared framework. The package is deployed as out-of-band (OOB) too and can be referenced into projects directly.
## Example
The following example shows how to bind a JSON configuration section to .NET objects.