I have a JSON which looks like this...
{
"ways": [
{
"wayType": "oneway",
"roadType": "cemented",
"sources": {
"mode": "road",
"resourceName": "ABJ Cement",
"activeType": {
"dealerName": "Enterprise CC",
"dealerAddress": "XYZ"
},
"activeCatalog": "CC Catalog Unit 2",
"activeOwner": "John",
"activeOwnerPin": "2238889",
"isVerified": true
}
},
{
"wayType": "oneway",
"roadType": "RCC",
"sources": {
"mode": "road v2",
"resourceName": "Global Unit Cement",
"activeType": {
"dealerName": "Catch Metal",
"dealerAddress": "XYZ"
},
"activeCatalog": "CC Catalog Unit 2",
"activeOwner": "John",
"activeOwnerPin": "2238889",
"isVerified": true
}
}
]
}
I have created a JSON structure Class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Console
{
public class activeType
{
public string dealerName{ get; set; }
public string dealerAddress{ get; set; }
}
public class sources
{
public string mode { get; set; }
public string resourceName { get; set; }
public ActiveType activeType { get; set; }
public string activeCatalog { get; set; }
public string activeOwner { get; set; }
public string activeOwnerPin { get; set; }
public bool isVerified{ get; set; }
}
public class ways
{
public string wayType{ get; set; }
public Sources sources { get; set; }
}
public class Root
{
public List<Step> ways { get; set; }
}
}
I want to parse it key by key and store it in a variable, I have created a class where I am reading the JSON file from file directory and then opening it. I am creating a console application.
How can I parse the JSON and get the value and store it. Any link to a documentation will be helpful.