How to cast base class into derived class by JavaScriptSerializer
BaseClass b = new BaseClass(){};
System.Web.Script.Serialization.JavaScriptSerializer ser = new System.Web.Script.Serialization.JavaScriptSerializer();
var json = ser.Serialize(b);
DerivedClass d = ser.Deserialize(json);
No comments:
Post a Comment