File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ var value = await configuration.GetAppSettingAysnc<string>("key");
62
62
Ever been in config hell where you don't know what key is used where.
63
63
This is where key formatters comes in useful, HumbleConfig has inbuilt support for a few key formatters.
64
64
65
- #### KeyPrefixer
65
+ ##### KeyPrefixer
66
66
The key prefixer allows you to specify a prefix that all your config keys should include.
67
67
For example having a prefix of ` HumbleConfig: ` would have the following output:
68
68
@@ -77,6 +77,29 @@ To setup this the key prefixer on our configuration object we just call `WithKey
77
77
configuration .WithKeyPrefixer (" HumbleConfig:" )
78
78
```
79
79
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
+
80
103
### Contributing
81
104
82
105
1 . Fork
You can’t perform that action at this time.
0 commit comments