I have a JSON string
{
"Date":"21/11/2010"
"name": "TEST"
"place":"xyz"
}
I want to convert it into a C# dictionary without using a third party library
I have a JSON string
{
"Date":"21/11/2010"
"name": "TEST"
"place":"xyz"
}
I want to convert it into a C# dictionary without using a third party library
You can do it natively since net 3.5 with jsonserializer.
var jss = new JavaScriptSerializer();
var dict = jss.Deserialize<Dictionary<string,string>>(jsonText);
var place = dict["place"]; // "xyz"
Here is a simple tutorial for your case: Quick JSON Serialization/Deserialization in C#
Requires the System.Web.Extensions reference. If you can't find it, your program is probably using a Client target framework. Use a "Full" target framework.
<string, dynamic> or just dynamic as show when you follow the tutorial link does.