File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,35 @@ public class SampleLambda
144
144
}
145
145
```
146
146
147
+ # Hierarchical configuration data
148
+ Let's assume we want to load configuration per the below class hierarchy:
149
+ ``` csharp
150
+ public class DemoConfig
151
+ {
152
+ public string TestItem { get ; set ; }
153
+ public DemoSubConfig SubConfig { get ; set ; }
154
+ }
155
+
156
+ public class DemoSubConfig
157
+ {
158
+ public string SubItem { get ; set ; }
159
+ }
160
+ ```
161
+ In System Manager parameter store, these hierarchical values could be represented with below names (notice the use of ` / ` delimiter):
162
+ | Name | Type |
163
+ | :-------- | :------- |
164
+ | /my-application/Config/TestItem | String |
165
+ | /my-application/Config/SubConfig/SubItem | String |
166
+
167
+ Using ` WebApplicationBuilder ` as an example, the above configuration hierarchy could be loaded using below code:
168
+ ``` csharp
169
+ var builder = WebApplication .CreateBuilder (args );
170
+
171
+ builder .Configuration .AddSystemsManager ($" /my-application/" );
172
+
173
+ builder .Services .Configure <DemoConfig >(builder .Configuration .GetSection (" Config" ));
174
+ ```
175
+
147
176
## Samples
148
177
149
178
### Custom ParameterProcessor Sample
You can’t perform that action at this time.
0 commit comments