ConvertJsonStringToObject
public static T ConvertJsonStringToObject<T>(this string stringToDeserialize) { JavaScriptSerializer serializer = new JavaScriptSerializer(); return serializer.Deserialize<T>(stringToDeserialize); }Example:
Person per = jsonString.ConvertJsonStringToObject<Person>();
Description
Converts a JSON string to an object
Details
- Author: Otto Beragg
- Submitted on: 11-3-2009 10:39:37
- Language: C#
- Type: System.String
- Views: 3004
Double click on the code to select all.