Строка JSON (часть):
Код: Выделить всё
{
"message": "Success",
"data": {
"100": {
"Type": "Solid",
"Name": "Sphere",
},
"101": {
"Type": "Solid",
"Name": "Cube",
},
"102": {
"Type": "Solid",
"Name": "Cylinder",
}
},
"Error": []
}
ID
ТипИмя
100
Сплошная
Сфера
< tr>
102
Сплошной
Куб
103
Сплошной
Цилиндр
Мой код:
Код: Выделить всё
var json = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
var jObject = JObject.Parse(json);
var flattened = jObject.Flatten();
foreach (var item in flattened)
{
Console.WriteLine(item.Key + " ### " + item.Value);
}
var flattenedJsonString = JsonConvert.SerializeObject(flattened, Formatting.Indented);
Console.WriteLine(flattenedJsonString);
Подробнее здесь: https://stackoverflow.com/questions/785 ... -sql-table
Мобильная версия