Deserialize JSON string to c# object


List of serializers


XmlSerializer: The XmlSerializer enables you to control how objects are encoded into XML.
JavaScriptSerializer:  Provides serialization and deserialization functionality for AJAX-enabled applications.
DataContractSerializer: DataContractSerializer class to serialize and deserialize instances of a type into an XML stream or document.
NetDataContractSerializer: NetDataContractSerializer can be used only if both the serializing and deserializing ends share the same CLR types.
DataContractJsonSerializer:  Serializes objects to the JavaScript Object Notation (JSON) and deserializes JSON data to objects.


string strjson= "{\"Age\":\"32\",\"Exp\":\"6 Years\",\"Name\":\"Tarun\",\"Technology\":\".NET\"}";
JavaScriptSerializer serializer1 = new JavaScriptSerializer();
object obje = serializer1.Deserialize<object>(strjson);
Next PostNewer Post Previous PostOlder Post Home

0 comments:

Post a Comment