title: serialize/deserialize List<T> to JSON
body: <p>I want to be able to serialize/deserialize a generic list what I so far is this</p>
  
  <pre><code>    public static string ToJson(this object obj, int recursionDepth = 100) 
      {
          JavaScriptSerializer serializer = new JavaScriptSerializer();
          serializer.RecursionLimit = recursionDepth;
          return serializer.Serialize(obj);
      }
  
      public static List&lt;T&gt; ToListObject&lt;T&gt;(this string obj, int recursionDepth = 100)
      {
          JavaScriptSerializer serializer = new JavaScriptSerializer();
          serializer.RecursionLimit = recursionDepth;
          List&lt;T&gt; returnList = serializer.Deserialize&lt;List&lt;T&gt;&gt;(obj);
          return returnList;
      }
  </code></pre>
  
  <p>I also tried <code>(List&lt;T&gt;)serializer.DeserializeObject(obj)</code></p>
  
  <p>With the <code>Deserialize</code> it deserializes wrong (to an empty <code>List&lt;T&gt;</code> object) and with <code>DeserializeObject</code> it throws an error saying 'Could not deserialize the given string into an array of T'. And I wont be able to use the IOStream :( Would really appriciate any insight.</p>
  
  <p>UPDATE: Even the basic serialization/deserialization works, it was just not my day when I posted this. :)</p>