When I have dictionary (IDictionary) items (in C#) with random string keys, I get the JSON object as:
{
"Y21qf39sXRU=":"A",
"/N+BQBzpdkA=":"A+",
"HQ5dFtxIsGo=":"B",
"2i4tdo427Sw=":"ACCOUNTANT",
"W6EuZP1+iKY=":"Accountant",
"eaSybclf0ww=":"Client", .... //and so on
But when I change keys to numeric keys, items in the dictionary gets sorted by keys as :
{
"1":"Closed Accounts",
"260":"A",
"283":"Client",
"334":"Accountant",
"437":"new CATEGORY",
"757":"Prospect",
"973":"A+",
"1099":"B", ....
Why is Newtonsoft.JSON serializer doing this and how to avoid sorting on numeric keys?
I want results as ordered in first JSON (as coming sorted from database). I know I can again do sorting of results, but for now I want to avoid doing that.