I\'m very new with JSON, please help!
I am trying to serialise a List as JSON
Currently:
You can use Newtonsoft and dictionary:
var dict = new Dictionary();
dict.Add(1, "one");
dict.Add(2, "two");
var output = Newtonsoft.Json.JsonConvert.SerializeObject(dict);
The output is :
{"1":"one","2":"two"}
Edit
Thanks to @Sergey Berezovskiy for the information.
You are currently using Newtonsoft, so just change your List to Dictionary and use the serialize and deserialize method from the package.