I have a List<> objects. Their class does not have the "color" ( String ) property, but I can get the value of this property for each element of the list just before serialization.
Is this the only way to include this property in a JSON object, to add it to the class and then serialize it all?
Or is there a way / approach to adding a property that should appear in a JSON object that would otherwise be useless in my class?
I know that this is possible with all sorts of string manipulation methods, but that doesn't seem right.
I am using DataContractJsonSerializer .
source share