我有一些想要使用 Json.Net 反序列化的 JSON,但我不想模仿 JSON 对象结构。例如我有这个订单对象:
{
"order":
{
"order_id": "111-22222222-33",
"account_identifier": "my account id",
"customer": "my customer",
"sku": "WALM-E-500-STD",
"amount": 500,
"reward_message": "my message is awesome",
"reward_subject": "my subject is awesome",
"reward_from": "me",
"delivered_at": "2013-11-10T12:49:00+00:00",
"recipient": {
"name": "me",
"email": "my@email.com"
},
"reward": {
"token": "1234567890.1234567890",
"number": "A1234567890",
"redemption_url": "http://some.domain.com/r/1234567890"
}
}
}
我不想要recipient
orreward
属性,而是想要将它们展平,以便 , name
, email
, token
,number
并redemption_url
成为订单的属性。那可能吗?