I have the following Json.
In the Json i want to read connectString and MetadataUrl in my C# app and write those values back to json with some other text.
{
"DBConnection": {
"connections": [
{
"connectString": "Server=(localdb)\\MSSQLLOCALDB;Initial Catalog=Test;",
"Region": "India",
}
],
},"Myapp": {
"RequestTimeoutAfterXHours": 24,
"TestIdSettings": [
{
"MetadataUrl": "http://localhost/Myapp/.well-known",
"Audience": "http://testurl.com"
}
]
},
"AllowedHosts": "*"
}
Varun SetiaPosted Jul 28, 2020, 4:13 AM
Jenith ThakkarPosted Jul 28, 2020, 1:48 AM
You can convert it from here
https://json2csharp.com/
Then deserialize that json and store all the value in class object
https://www.c-sharpcorner.com/article/json-serialization-and-deserialization-in-c-sharp/
Check this example of deserialization
Thank you