0
我有5个产品,价格为12个月的列出以下格式转换JSON从一种格式对象到另一个在C#
dynamic product = new JObject();
product.ProductName = "Elbow Grease";
product.Price = 4.90;
product.year = 2016;
product.month = 01;
product.ProductName = "Jeans";
product.Price = 4.10;
product.year = 2016;
product.month = 01;
product.ProductName = "Jeans";
product.Price = 2.90;
product.year = 2016;
product.month = 02;
,现在我需要这个JSON如下发送转换为另一种格式以我的观点
[
{
"year": 2016,
"month": 01,
"Elbow Grease": 4.90,
"Jeans": 4.10
},
{
"year": "2016",
"month":"02",
"Elbow Grease": 0, //since not available
"Jeans": 2.90
}]
你确定你的json例子有效吗? –