title: Getting ServiceStack to retain type information
body: <p>I'm using ServiceStack to serialize and deserialize some objects to JSON. Consider this example: </p>
  
  <pre><code>public class Container
  {
      public Animal Animal { get; set; }
  }
  
  public class Animal
  {
  }
  
  public class Dog : Animal
  {
      public void Speak() { Console.WriteLine("Woof!"); }
  }
  
  var container = new Container { Animal = new Dog() };
  var json = JsonSerializer.SerializeToString(container);
  var container2 = JsonSerializer.DeserializeFromString&lt;Container&gt;(json);
  
  ((Dog)container.Animal).Speak(); //Works
  ((Dog)container2.Animal).Speak(); //InvalidCastException
  </code></pre>
  
  <p>The last line throws a InvalidCastException, because the Animal field is instantiated as an Animal type, not a Dog type. Is there any way I can tell ServiceStack to retain the information that this particular instance was of the Dog type?</p>