に、私は5品と価格のリストを持っている次の形式で12ヶ月間別に改宗1つの形式から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の例が有効ですか? –