The below code will solve your problem:
- Create the main Class that will keep your
List:
public class JsonList
{
public List<MainListKeep> ListToKeep { get; set; }
}
- Create the Class that defines the type of the items of the
JsonList class:
public class MainListKeep
{
public string feature_id { get; set; }
public string feature_code { get; set; }
public string company_id{ get; set; }
public string feature_type { get; set; }
public string parent_id{ get; set; }
...
...
...
...
public List<VariantsList> variants{ get; set; }
}
- Create the Class that defines the type of the items of the
variants:
public class VariantsList
{
public string variant_id { get; set; }
public string variant { get; set; }
public string description { get; set; }
public string page_title { get; set; }
...
...
...
...
}
And then you deserialize using this:
JsonList jsonList = new JsonList();
jsonList = JsonConvert.DeserializeObject<JsonList>(YourJSONContentString);
And then you have all of your JSON Response items in the jsonList object and you can use them as you want.
The names of the variables that are relevant with your code must be the same as you can see above in the classes that I have created.