using System;
using System.Collections.Generic;
using System.Dynamic;
using Newtonsoft.Json;
public class Program
{
public static void Main()
int[,] myArr = {
{1, 2},
{3, 4}
};
dynamic myObj = new ExpandoObject();
myObj.Ints = new dynamic[myArr.Length];
int index = 0;
foreach(var myInt in myArr)
myObj.Ints[index] =
new
value = myInt,
value_plus_1 = myInt + 1
index++;
}
Console.WriteLine(JsonConvert.SerializeObject(myObj));