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