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": "*"
}

Jenith ThakkarRank #789 · 2.9K reputationPosted Jul 27, 2020, 9:48 PM EDT
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
Varun SetiaRank #308 · 8.2K reputationPosted Jul 28, 2020, 12:13 AM EDT