parsing int when doing json deserialization
<p>I'm writing a custom javascript converter and I'm receiving a string that should contain an int.
This is what I'm doing:</p>

<pre><code>public class MyObjectToJson : JavaScriptConverter
{
public override object Deserialize(IDictionary&lt;string, object&gt; dictionary, Type type, JavaScriptSerializer serializer)
{

  MyObject TheObject = new MyObject; 

  if (serializer.ConvertToType&lt;int&gt;(dictionary["TheInt"]) == true)
  {
    MyObject.TheInt = serializer.ConvertToType&lt;int&gt;(dictionary["TheInt"]);
  }
</code></pre>

<p>However, it's not working on the conditional statement. What do I need to change? I want to test that I'm getting an int.</p>

<p>Thanks.</p>
