This article is about a cool feature in Visual Studio that helps save the effort of a developer to generate class a structure from a JSON or XML string.
Introduction This article is about a cool feature in Visual Studio that helps save the effort of a developer to generate class a structure from a JSON or XML string. There is cases application written using the .NET Framework written by a developer that receives a JSON or XML string from a web service or from another third party application. After receiving JSON or XML string data there is a need for further processing of the received data that requires deserialization of the received JSON or XML in a .Net object. And for that a .Net class structure must be created to match the JSON or XML string data so that the JSON or XML string can be deserialized correctly. Problem Statement For example, a program receives the following JSON string by calling a web service or third-party program. JSON
Approach 2: Automated using Visual Studio This approach uses Visual Studio to generate a class just by copying and pasting the JSON or XML string. The following is the procedure to generate the class:
Below is example of class structure created by copy and pasting XML string
Pro WPF: Windows Presentation Foundation in .NET 3.0