Skip to content

Commit d87b2a4

Browse files
committed
Add README.md
0 parents  commit d87b2a4

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# C9S.Extensions.Configuration
2+
3+
4+
### Usage
5+
---
6+
7+
This
8+
9+
```json
10+
{
11+
"General":
12+
{
13+
"HttpListenPort": "3000",
14+
"HttpsListenPort": "3001",
15+
"WebUrl": "https://localhost:{{General.HttpsListenPort}}"
16+
},
17+
"Pages":
18+
{
19+
"AuthorizeAddress": "{{General.WebUrl}}/api/beta/authorize",
20+
"DashboardAddress": "{{General.WebUrl}}/dashboard"
21+
}
22+
}
23+
```
24+
25+
Becomes
26+
27+
```json
28+
{
29+
"General":
30+
{
31+
"HttpsListenPort": "3001",
32+
"WebUrl": "https://localhost:3001"
33+
},
34+
"Pages":
35+
{
36+
"AuthorizeAddress": "https://localhost:3001/api/beta/authorize",
37+
"DashboardAddress": "https://localhost:3001/dashboard"
38+
}
39+
}
40+
```
41+
42+
After running
43+
44+
```cs
45+
IConfigurationRoot configuration = ...
46+
configuration.ResolveVariables();
47+
```
48+
49+
ResolveVariables will take any variable path and resolve it. It even works across .json files. As long as the data is stored inside the ConfigurationRoot, it is resolvable

0 commit comments

Comments
 (0)