I want to create a 3D array out of list in C #
Say my data is like
[{"axis":"NW","value":1.00},{"axis":"SW","value":1.00},{"axis":"EE","value":1.00}]
What type of array is this?
var data = [
[//iPhone
{axis:"Battery Life",value:0.22},
{axis:"Brand",value:0.28},
{axis:"Contract Cost",value:0.29},
{axis:"Design And Quality",value:0.17},
{axis:"Have Internet Connectivity",value:0.22},
{axis:"Large Screen",value:0.02},
{axis:"Price Of Device",value:0.21},
{axis:"To Be A Smartphone",value:0.50}
]
{axis:"Battery Life",value:0.27},
{axis:"Brand",value:0.16},
{axis:"Contract Cost",value:0.35},
{axis:"Design And Quality",value:0.13},
{axis:"Have Internet Connectivity",value:0.20},
{axis:"Large Screen",value:0.13},
{axis:"Price Of Device",value:0.35},
{axis:"To Be A Smartphone",value:0.38}
],
[//Nokia Smartphone
{axis:"Battery Life",value:0.26},
{axis:"Brand",value:0.10},
{axis:"Contract Cost",value:0.30},
{axis:"Design And Quality",value:0.14},
{axis:"Have Internet Connectivity",value:0.22},
{axis:"Large Screen",value:0.04},
{axis:"Price Of Device",value:0.41},
{axis:"To Be A Smartphone",value:0.30}
]
What I have tried:
List<HCP_Prfm_Chart> lstdtl = new List<HCP_Prfm_Chart>();
foreach (DataRow dr in ds.Tables[0].Rows)
{
lstdtl.Add(new HCP_Prfm_Chart
{
axis = dr["axis"].ToString(),
value = Convert.ToInt32(dr["value"])
});
}
HCP_Prfm_Chart[] Myarry = lstdtl.ToArray();
return Json(Myarry, JsonRequestBehavior.AllowGet);
How can i return this type of array back from this function
[{"axis":"NW","value":1.00}],[{"axis":"SW","value":1.00}]