title: .NET Deserializing JSON to multiple types
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/11429546/deserializing-json-into-one-of-several-c-sharp-subclasses">Deserializing JSON into one of several C# subclasses</a>  </p>
  </blockquote>
  
  
  
  <p>I have read-only access following JSON schema:</p>
  
  <pre><code>{ items: [{ type: "cat", catName: "tom" }, { type: "dog", dogName: "fluffy" }] }
  </code></pre>
  
  <p>I would like to deserialize each of these to their respective type:</p>
  
  <pre><code>class Cat : Animal {
      string Name { get; set; }
  }
  class Dog : Animal {
      string Name { get; set; }
  }
  </code></pre>
  
  <p>My only thought at this point is to deserialize them to a <code>dynamic</code> object, or <code>Dictionary&lt;string, object&gt;</code> and then construct these objects from there. </p>
  
  <p>I may be missing something from one of the JSON frameworks out there.... </p>
  
  <p>What would your approach be? =]</p>