Код: Выделить всё
Key: $.orderNumber Value: "100001"
Key: $.orderedOn Value: "01-01-2021"
Key: $.product.name Value: "hard"
Key: $.product.type Value: "plastic"
Key: $.contacts[?(@.contactType == 'primary')].phone Value: "101010101010"
Key: $.contacts[?(@.contactType == 'secondary')].phone Value: "2020202020"
Код: Выделить всё
{
"orderNumber": "100001",
"orderedOn": "01-01-2021",
"product": {
"type": "hard",
"name": "plastic"
},
"contacts": [
{
"contactType": "primary",
"phone": "101010101010"
},
{
"contactType": "secondary",
"phone": "202020202020"
}
]
}
Я хотел создать объекты JSON динамически.
Я попробовал Json.net Unflatten, но он не покрывает ключ условного массива.
Подробнее здесь: https://stackoverflow.com/questions/665 ... in-c-sharp
Мобильная версия