Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Configuration doc to use double underscores instead of colons for hierarchical config keys (4968) #5876

Merged
merged 15 commits into from
Apr 5, 2018
Merged
5 changes: 2 additions & 3 deletions aspnetcore/fundamentals/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The app reads and displays the following configuration settings:

[!code-json[](index/sample/ConfigJson/appsettings.json)]

Configuration consists of a hierarchical list of name-value pairs in which the nodes are separated by a colon. To retrieve a value, access the `Configuration` indexer with the corresponding item's key:
Configuration consists of a hierarchical list of name-value pairs in which the nodes are separated by a double underscore (`__`). To retrieve a value, access the `Configuration` indexer with the corresponding item's key:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't quite right. The double underscore syntax only applies to config values specified in env vars. When interacting with the config api you should use colons.


[!code-csharp[](index/sample/ConfigJson/Program.cs?range=21-22)]

Expand Down Expand Up @@ -108,8 +108,7 @@ Configuration considerations:
* `IOptionsSnapshot` can reload configuration data when it changes. For more information, see [IOptionsSnapshot](xref:fundamentals/configuration/options#reload-configuration-data-with-ioptionssnapshot).,
* Configuration keys are **not** case-sensitive.
* **Never** store passwords or other sensitive data in configuration provider code or in plain text configuration files. Don't use production secrets in development or test environments. Specify secrets outside of the project so that they can't be accidentally committed to a source code repository. Learn more about [how to work with multiple environments](xref:fundamentals/environments) and managing [safe storage of app secrets in development](xref:security/app-secrets).
* If a colon (`:`) can't be used in environment variables on a system, replace the colon (`:`) with a double-underscore (`__`).

* A colon (`:`) may also be used for hierarchigal config keys, but may not work on all platforms. Double underscore (__) is supported by all platforms.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • may also --> may
  • hierarchigal --> hierarchical

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

## In-memory provider and binding to a POCO class

The following sample shows how to use the in-memory provider and bind to a class:
Expand Down