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:
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
Post a Comment