Suppose I want to deserialize a Json dataset into a Person object.
class Person { [DataMember] string name; [DataMember] int age; [DataMember] int height; object unused; }
But if I have Json data like the one below:
{ "name":"Chris", "age":100, "birthplace":"UK", "height":170, "birthdate":"08/08/1913", }
The fields "date of birth" and "place of birth" are not included in the Person class. But I still want to save these fields, so can I use Json.net or other libraries that can store these additional fields in one of the Person fields, such as "unused", as mentioned above?
user2395837
source share