I'm trying to create this JSON string in C#
[
{
accountId = 123,
reportType = 1,
reportTypeDesc = "Daily"
},
{
accountId = 123,
reportType = 1,
reportTypeDesc = "Daily"
},
{
accountId = 123,
reportType = 1,
reportTypeDesc = "Daily"
}
]
I tried this way to do this json , here is my code :
var body = new []
new
{
accountId = 123,
reportType = 1,
reportTypeDesc = "Daily"
},
new
{
accountId = 123,
reportType = 1,
reportTypeDesc = "Daily"
},
new
{
accountId = 123,
reportType = 1,
reportTypeDesc = "Daily"
},
But I have compiler errors in "new[]" area
What is the right way to make this Json ? i tried all lots of different variation but nothing works