I have some JSON that nicely deserializes (with DataContractJsonSerializer) to:
class Datum { /* properties */ }
Is there a decoration (in WinRT) to trick the Serializer?
Something like this:
[DataContract(Name="Datum")]
class Hamburger { /* properties */ }
Unfortunately that does not work.
I just want a Hamburger class, not a “Datum” class.
Possible?
Well [DataContract(Name=”Datum”)] is the right answer. What appears to be my problem is that once you use [DataContract] you need to use [DataMember] on all the properties. Otherwise, all the properties are null after it is deserialized.