How do I get DataContractJsonSerializer to use concrete type in type hint when serializing generic class from interface
问题 I have a set of classes as follows: a Command, which Executes and stores a Result; a Response, which is created as in order to return the Result in a serialized form (plus extra metadata which I've left out). The Response.Result must be of type object, as it is used for a bunch of different commands, each of which can have a Result of any type at all. The Command is generic, and I'd like it to accept an interface rather than concrete type, but when I do, the serialized response contains the