-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
Changes from 10 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
86ecc0f
Merge pull request #1 from aspnet/master
isaac2004 3e02c76
Merge pull request #2 from aspnet/master
isaac2004 08fbd77
Merge pull request #3 from aspnet/master
isaac2004 3ea3551
Merge pull request #4 from aspnet/master
isaac2004 9fec852
Merge pull request #5 from aspnet/master
isaac2004 3f95071
Merge pull request #6 from aspnet/master
isaac2004 ecf344a
Merge pull request #7 from isaac2004/master
isaac2004 1c2ebd6
changes to configuration doc
cfc76bb
Merge pull request #8 from aspnet/master
isaac2004 524e7e0
fix merge conflict
isaacrlevin 57c65f5
fixes for scott
isaac2004 73f00dc
change for Dan
isaac2004 6c8a596
Update index.md
isaac2004 5e12f44
Code fence double underscore and add missing period
scottaddie 066a97d
Eliminate unnecessary sentence
scottaddie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
||
[!code-csharp[](index/sample/ConfigJson/Program.cs?range=21-22)] | ||
|
||
|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.