Generate C# Classes From JSON Code

Introduction
 
Generate c# classes using get set properties and related properties and its object from Json code format.

Description

We can modify data type of variable based on json code format int to double and double to int etc. 
 
Source

For this I have used one online tool
 
 
Steps

First go to this site:
 
 
 
 
Then type your Json code and click the Generate button. 
  1. {"Satyaprakash":{"Gender":7.31,"Profession":187.002,"Study":187.004,"Stay":187.0087}} 
Here "Satyaprakash" will be the name of the c# class and "Gender ,Profession,Study,Stay" will be the name of the
properties of "Satyaprakash" c# class.
 
 
 
Here all datatype is double . If you change decimal to int then the data type will be changed to int.

For example for Gender : 7.31 changed to 7 .
 
 
 
In last you will get a parent class like "RootObject" by default. You can change this name as per requirement.

Inside this parent class , the base class "Satyaprakash" object name "Satyaprakash" is instantiate.
 
 
Summary

Get Online tool. Write Json code. Generate expected base classes, its properties and objects put in parent class. Change data type and name of the by default parent class. 
Ebook Download
View all
Learn
View all