I am trying to convert some data from one JSON format to another, but running into to some issues.
[
[{"Key":"entity_id","Value":"1"},{"Key":"CustomerName","Value":"Test1"},{"Key":"AccountNumber","Value":"ACC17-001"},{"Key":"CustomerType","Value":"Direct Sale"}],
[{"Key":"entity_id","Value":"2"},{"Key":"CustomerName","Value":"Test2"},{"Key":"AccountNumber","Value":"ACC17-002"},{"Key":"CustomerType","Value":"Direct Sale"}],
[{"Key":"entity_id","Value":"3"},{"Key":"CustomerName","Value":"Test3"},{"Key":"AccountNumber","Value":"ACC17-003"},{"Key":"CustomerType","Value":"Direct Sale"}],
[{"Key":"entity_id","Value":"4"},{"Key":"CustomerName","Value":"Test4"},{"Key":"AccountNumber","Value":"ACC17-004"},{"Key":"CustomerType","Value":"Direct Sale"}],
[{"Key":"entity_id","Value":"5"},{"Key":"CustomerName","Value":"Test5"},{"Key":"AccountNumber","Value":"ACC17-005"},{"Key":"CustomerType","Value":"Invoice"}],
[{"Key":"entity_id","Value":"6"},{"Key":"CustomerName","Value":"Test6"},{"Key":"AccountNumber","Value":"ACC17-006"},{"Key":"CustomerType","Value":"Invoice"}]
]
Into this:
[
{"entity_id":"1","CustomerName":"Test1","AccountNumber":"ACC17-001","CustomerType":"Direct Sale"},
{"entity_id":"2","CustomerName":"Test2","AccountNumber":"ACC17-002","CustomerType":"Direct Sale"},
{"entity_id":"3","CustomerName":"Test3","AccountNumber":"ACC17-003","CustomerType":"Direct Sale"},
{"entity_id":"4","CustomerName":"Test4","AccountNumber":"ACC17-004","CustomerType":"Direct Sale"},
{"entity_id":"5","CustomerName":"Test5","AccountNumber":"ACC17-005","CustomerType":"Invoice"},
{"entity_id":"6","CustomerName":"Test6","AccountNumber":"ACC17-006","CustomerType":"Invoice"}
]
The first data source is a dynamic sql query...and i need to generate a custom object with the columns of that sql query as the properties of the object and then encode it into JSON for the webservice to reply with.
I am using c# as the intermediate layer.