Skip to content

Commit ca592aa

Browse files
committed
Updating README
1 parent 922bdf0 commit ca592aa

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var value = await configuration.GetAppSettingAysnc<string>("key");
6262
Ever been in config hell where you don't know what key is used where.
6363
This is where key formatters comes in useful, HumbleConfig has inbuilt support for a few key formatters.
6464

65-
#### KeyPrefixer
65+
##### KeyPrefixer
6666
The key prefixer allows you to specify a prefix that all your config keys should include.
6767
For example having a prefix of `HumbleConfig:` would have the following output:
6868

@@ -77,6 +77,29 @@ To setup this the key prefixer on our configuration object we just call `WithKey
7777
configuration.WithKeyPrefixer("HumbleConfig:")
7878
```
7979

80+
##### KeyPostfixer
81+
The key postfixer allows you to specify a postfix that all your config keys should include.
82+
For example having a postfix of `.HumbleConfig` would have the following output:
83+
84+
| Key | Source Key |
85+
| -------|------------------ |
86+
| Key1 | Key1.HumbleConfig |
87+
| Key2 | Key2.HumbleConfig |
88+
| Key3 | Key3.HumbleConfig |
89+
90+
To setup this the key postfixer on our configuration object we just call `WithKeyPostfixer`:
91+
```csharp
92+
configuration.WithKeyPostfixer(".HumbleConfig")
93+
```
94+
95+
#### Key formatters on sources
96+
97+
It is also possible to use key formatter on individual sources, for example:
98+
```
99+
configuration.AddEnvironmentVariables().WithKeyPostfixer(".production")
100+
```
101+
This will only apply the key formatter to the environment variables source.
102+
80103
### Contributing
81104

82105
1. Fork

0 commit comments

Comments
 (0)