How to convert JSON to C# classes?

后端 未结 4 1952

I have a complex JSON object that I want represent as C# class. I have a head start on the parent class called \"Form\", but how can I represent a collection for different t

4条回答
  •  鱼传尺愫
    2020-12-19 07:28

    If you just want to make sure all this unknown data gets deserialized and can be reserialized at some point in the future, I suggest the usage of IExtensibleDataObject.

    Here are some samples to get you started. Hope this helps! (If you already knew this and were looking for something different...let me know!)

    Forward-Compatible Data Contracts

    Data Contract Versioning

    Useful clarifying thread on the topic at MSDN forums

提交回复
热议问题