title: deserialize json string depending on type
body: <p>Having json strings like this (I have no control over the publisher):</p>
  
  <pre><code>{
    "TypeName": "Type1"
  }
  
  {
    "TypeName": "Type1"
  }
  </code></pre>
  
  <p>Is this an acceptable way to deserialize the json strings dynamically?:</p>
  
  <pre><code>public class DeserializationFactory
  {
      public static IPoco GetEvent(string jsonString)
      {
          var o = JObject.Parse(jsonString);
          IPoco poco = null;
          switch (o["TypeName"].ToString())
          {
          case "Type1":
              poco = JsonConvert.DeserializeObject&lt;Type1&gt;(jsonString);
              break;
  
          case "Type2":
              poco = JsonConvert.DeserializeObject&lt;Type2&gt;(jsonString);
              break;
          }
          return poco;
      }
  }
  </code></pre>