If you’re working with JSON, say for REST web services, and you don’t have the class to unmarshal the response, Visual Studio can automatically generate the class for you:

  1. Open your Visual Studio Project and create a class file. Delete the contents: Class creation
  2. Copy the JSON text string you will need to unmarshall onto the clipboard. Take this example from the JSON Placeholder mock API:
{
	"userId": 1,
	"id": 1,
	"title": "delectus aut autem",
	"completed": false
}
  1. Go to Edit > Paste Special > Paste JSON as Classes: Paste Special The result is a class named “Rootobject” that you can use to unmarshall the information on your code.