I want to be able to serialize/deserialize a generic list what I so far is this
public static string ToJson(this object obj, int recursionDepth = 100)
{
Try this on for size:
public static T ToObject<T>(this string obj, int recursionDepth = 100)
{
JavaScriptSerializer serializer = new JavaScriptSerializer();
serializer.RecursionLimit = recursionDepth;
return serializer.Deserialize<T>(obj);
}
Then use it like this:
mystring.ToObject<List<MyClass>>();