I have a class
public class MyClass
{
public string v1 { set; get; }
public string v2 { set; get; }
public string v3 { set; get; }
public string i1 { set; get; }
public string i2 { set; get; }
public string i3 { set; get; }
public string error { set; get; }
public string date { set; get; }
}
when i Serialize the class
MyClass meter = new MyClass();
var json = new JavaScriptSerializer().Serialize(meter);
i get
{
"v1":"2342",
"v2":"2336",
"v3":"2332",
"i1":"38.90",
"i2":"42.21",
"i3":"30.87",
"error":"",
"date":"26/02/2015 08:16:14"
}
how can i change the display name of every member (like [ScriptIgnore])
i tried [Display(Name = "myname")]