Если бы я хотел индексировать в price
или galleryId
в этом json файле:
{
"searchId": null,
"listings": [{
"sid": 0,
"id": 25,
"status": 3,
"art": {
"sid": 0,
"artId": 24,
"token": "v",
"name": "A",
"description": "F",
"width": 18.0000,
"height": 24.0000,
"metricWidth": 0.4572,
"metricHeight": 0.6096,
"mediaType": "",
"fullSizeImageUrl": "http",
"thumbnailImageUrl": "http",
"artist": {
"token": null,
"firstName": "V",
"lastName": "G",
"visibleInSearch": false,
"inventoryVisibleInSearch": false
}
},
"galleryId": 1,
"price": 1750,
"listed": "2020-01-18T21:49:41.447"
}]
, это будет правильный синтаксис?
{
for (int i = 0; i < itemData[0]["listings"].Count; i++)
{
database.Add(new Art(itemData[0]["listings"][i]["galleryId"].ToString(),
(int)itemData[0]["listings"][i]["price"]));