c# - How to get class properties in order of declaration when serialize -


i have list<campaignmodel> need serialize using jsonconvert.serializeobject

everything works fine except im getting properties in diferent order class declaration.

my class declaration is:

 public class campaignmodel     {         public string checked { get; set; }         public int campaignid { get; set; }         public string name { get; set; }         public string market { get; set; }         public string type { get; set; }         public bool isactive { get; set; }         public bool active { get; set; }     } 

and order im getting properties in json is:

enter image description here

any clue?

properties not guaranteed have or maintain specific order in javascript. in c# code can't change "limitation".

btw, the same goes .net.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -