using Newtonsoft.Json.Linq;
public static void Main()
string responseString = @"{
""description"": ""Identification of the watch list. A watch list is a set of securities which is used for simulation in the Benchmark and Portfolio Analysis""
""title"": ""Watch type""
""title"": ""Security ID""
""title"": ""Security No.""
""title"": ""Instrument Type"",
""title"": ""Watch list"",
""description"": ""Choose an existing Watch list, though not this""
""title"": ""Watch type""
""title"": ""Security ID""
""title"": ""Security No.""
""title"": ""Instrument Type"",
""title"": ""Watch list"",
""description"": ""Choose an existing Watch list, though not this""
JObject jo = JObject.Parse(responseString);
JToken dataSource = jo.SelectToken("$");
string name = (dataSource.Single() as JProperty).Name;
Console.WriteLine("Name - " + name);
var dataSourceProperties = dataSource.SelectTokens(name + ".items.properties[?(@.[?(@.type != 'array')])]").ToDictionary(p => (p as JProperty).Name);
var items = dataSource.SelectTokens(name + ".items.properties[?(@.[?(@.type == 'array')])]").ToDictionary(p => (p as JProperty).Name);
Console.WriteLine("Properties: (Create a cicle for PropertyList)");
foreach(var prop in dataSourceProperties){
Console.WriteLine("Name - " + prop.Key);
Console.WriteLine("Value - " + prop.Value);
Console.WriteLine("Items: (Create a cicle for Items)");
foreach(var item in items){
Console.WriteLine("Name - " + item.Key);
Console.WriteLine("Value - " + item.Value);