Hi,
You can use multi-dimensional array to achieve this.
Below is the code to solve your problem.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication3
{
public partial class WebForm4 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
PictureRead pictureRead = new PictureRead();
pictureRead.pictureId = "656f33d5-8aec-4f50-ac01-e81e7435cf57";
pictureRead.name = "A1";
pictureRead.canEdit = true;
pictureRead.isOwner = true;
object[][] objsubComponents = new object[3][];
objsubComponents[0] = new object[2] { 2, "default:42a18f47-7033-432a-82ce-a5bd00f8f5f8" };
objsubComponents[1] = new object[2] { 2, "default:f8c44f44-e716-4b17-b1b7-a5bd00b2007f" };
objsubComponents[2] = new object[2] { 2, "default:94003fd5-b3d6-4c95-a540-a5bd00b18bdc" };
pictureRead.subComponents = objsubComponents;
string json = Newtonsoft.Json.JsonConvert.SerializeObject(pictureRead);
}
}
public class PictureRead
{
public PictureRead()
{
subComponents = new object[3][];
aclPermissions = new object[0];
}
public string pictureId { get; set; }
public string name { get; set; }
public bool canEdit { get; set; }
public bool isOwner { get; set; }
public object[][] subComponents { get; set; }
public object[] aclPermissions { get; set; }
public int version { get; set; }
}
}
Thanks,