1

I have string

{"_t":"P","command":{"_t":"DuelCommand","duelStatus":"Waiting"}}

And classes:

public class P{
   PingCommand command;
}

public abstract class PingCommand{    
   public virtual void DoCommand(){
   }    
}

public class DuelCommand : PingCommand {
   public virtual void DoCommand(){
   }
}

When deserializing it gives me PingCommand instead of DuelCommand, how could I do it right?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
sandris
  • 1,478
  • 2
  • 18
  • 34
  • I have edited your title. Please see, "[Should questions include “tags” in their titles?](http://meta.stackexchange.com/questions/19190/)", where the consensus is "no, they should not". – John Saunders Nov 06 '13 at 15:31
  • possible duplicate of [Deserializing polymorphic json classes without type information using json.net](http://stackoverflow.com/questions/19307752/deserializing-polymorphic-json-classes-without-type-information-using-json-net) – Brian Rogers Oct 27 '14 at 03:16

0 Answers0