I have some JSON that I want to deserialize using Json.Net but I don't want to mimic the JSON object structure. For example I have this order object:
{
"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"
}
}
}
I don't want recipient
or reward
properties, instead I want to flatten those so that name
, email
, token
, number
, and redemption_url
become properties of the order. Is that possible?