[Solved] How can I create JSONARRAY in asp.net or c # [closed]


Why do I have a feeling that the OP isn’t a type safe developer and is actually asking, “how do I write a class that serializes to ‘this’ output?”

public class Foo
{
    public List<Bar> Android {get;set;}

}
public class Bar
{
    public string Ver { get; set; }
    public string Name { get; set; }
    public string Api { get; set; }
}

var foo = new Foo{
     Android = new List<Bar>
     {
         new Bar { Ver = "1.5", Name = "Cupcake", Api = "Api Level 3"},
         new Bar { Ver = "1.6", Name = "Donut", Api = "Api Level 4"},
     }
};
var bar = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(foo);

0

solved How can I create JSONARRAY in asp.net or c # [closed]