0

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?

dbc
  • 104,963
  • 20
  • 228
  • 340
Jerry Nixon
  • 31,313
  • 14
  • 117
  • 233

1 Answers1

0

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.

Jerry Nixon
  • 31,313
  • 14
  • 117
  • 233