Showing Tag: "classes" (Show all posts)

Paste JSON as Classes

Posted by jineesh uvantavida on Thursday, November 10, 2022, In : Tips & Ideas. 
Paste JSON as Classes

When working with APIs we often send a request and receive JSON data. Using C#, we need to transform the data into an object tree. That’s where what I’m going to show you is a game-changer.

First, let’s assume we receive the following JSON data from an API:
{
  "squadName": "Super hero squad",
  "homeTown": "Metro City",
  "formed": 2016,
  "secretBase": "Super tower",
  "active": true,
  "members": [
    {
      "name": "Molecule Man",
      "age": 29,
      "secretIdentity": ...

Continue reading ...
 
 

Translate This Page

 


Make a free website with Yola