我有字符串
{"_t":"P","command":{"_t":"DuelCommand","duelStatus":"Waiting"}}
和类:
public class P{
PingCommand command;
}
public abstract class PingCommand{
public virtual void DoCommand(){
}
}
public class DuelCommand : PingCommand {
public virtual void DoCommand(){
}
}
当反序列化它给我 PingCommand 而不是 DuelCommand,我怎么能做对?