JSON and XML files are a common way to serialize object content into a file. Once the object state is inside the file it can be persisted to storage. This tip looks at how to use the "Paste JSON as Classes" command to convert the JSON information from the file into a C# or Visual Basic class definition.
- [Instructor] JSON and XML files are a common way…to serialize object content into a file.…Once the object state is inside the JSON or XML file,…then you can persist the file to a cloud.…Later, you can open the JSON file,…de-serialize the state, rehydrate the object.…In this example I have here, I've got a JSON file.…And this represents the state of the object.…I would have had a class, probably,…with a property name StopNumber.…And this was the value that was stored in the file.…And there's a property called Name,…and this is the string that was stored inside the file.…
The rest of these are different properties in the class.…There's usually a one-to-one relationship…between the data that is in this file…and the properties or fields that are in your object.…What I want to look at in this tip…is when you have a JSON file like this…but don't you have the correct class file yet.…Now that could be the case…when you're working with an API…and you're getting the JSON data.…Or it could be the case…where someone has given you a JSON file…
Skill Level Intermediate
New This Week
Use the GitHub Extension1m 39s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.