Can you Instantiate an Object Instance from JSON in .NET?

前端 未结 5 1653
一向
一向 2021-01-02 09:20

Since Object Initializers are very similar to JSON, and now there are Anonymous Types in .NET. It would be cool to be able to take a string, such as JSON, and create an Anon

5条回答
  •  暖寄归人
    2021-01-02 09:54

    You should check out the JSON.net project:

    http://james.newtonking.com/pages/json-net.aspx

    You are basically talking about the ability to hydrate an object from JSON, which this will do. It won't do the anonymous types, but maybe it will get you close enough.

提交回复
热议问题