I have the following JSON which is serialized from a hashset Hashset<RootObject,List<Messages>>
{
"GasmonConsole.RootObject": [],
"GasmonConsole.RootObject": [],
"GasmonConsole.RootObject": [],
"GasmonConsole.RootObject": [],
"GasmonConsole.RootObject": [],
"GasmonConsole.RootObject": [],
"GasmonConsole.RootObject": [],
"GasmonConsole.RootObject": [],
"GasmonConsole.RootObject": [],
"GasmonConsole.RootObject": []
}
Where RootObject is
public class RootObject
{
public double x { get; set; }
public double y { get; set; }
public string id { get; set; }
}
I am using JSON.NET like this: string json = JsonConvert.SerializeObject(tracker,Formatting.Indented);
to serialize the Hashset.
The values exports perfectly when I fill this hashset with data but the headers(Key in the sash) where it says "GasmonConsole.RootObject"
isn't useful as it doesn't allow me to identify which object is which. I have tried some of the examples I think relate to my issue on the JSON.NET documentation but none of them see to work.
I am looking to have the headers be the ID of the RootObject (example below) but as I said I have tried the example above and it didn't work. Is this possible and if so could someone please point me in the right direction?
{
"111": [],
"112": [],
"113": []
}
I also apologize if header is the wrong term to refer to these values as.
Thanks!