I am currently working with json.net ! I know how to deserialize json data and how to map with our class. Now I am eager about some queries !
Suppose my jsonstrings is
"attributes":{
"color":"Brown",
"condition":"Used",
"currency":"USD",
"price":"10500",
"price_display":"$10,500",
}
and my attribute class ( in which i want to deserialize above string) is
Public class Attribute
{
public string name{ get; set; }
public string value{ get; set; }
}
Now I am using following code for deserialization.!
JavaScriptSerializer ser = new JavaScriptSerializer();
<classname> p = ser.Deserialize<classname>(jsonString);
And Obviously this code is not going to work for above jsonstring at all.
Now How can I bind these name value pair in one class ?? Is this possible ?
In future, attributes may b more than 10 but format will be same as name value pair