Featured
    public class Employee
    {
        public string DepId { get; set; }
        public string firstName { get; set; }
        public string lastName { get; set; }
    }

    public class Department
    {
        public string ID { get; set; }
        public string Name { get; set; }
        public IList<Employee> Employees { get; set; }
    }


Get & Set

Step 1 : Copy the JSON object or string body inside the first code editor

Make sure that the JSON object or string is well formatted. The JSON object should be wrapped with curly braces { } and should not be escaped by backslashes.

Example JSON:


    {
        "Class1": {
            "id": "4",
            "user_id": "user_id_value",
            "awesomeobject": {
                "SomeProps1": 1,
                "SomeProps2": "test"
            },
            "created_at": "2015-06-02 23:33:59",
            "updated_at": "2015-06-02 23:33:59",
            "users": [
                {
                    "id": "6",
                    "name": "Test Child 1",
                    "created_at": "2015-06-02 23:33:59",
                    "updated_at": "2015-06-02 23:33:59",
                    "email": "test@gmail.com"
                },
                {
                    "id": "6",
                    "name": "Test Child 1",
                    "created_at": "2015-06-02 23:33:59",
                    "updated_at": "2015-06-02 23:33:59",
                    "email": "test@gmail.com",
                    "testanadditionalfield": "tet"
                }
            ]
        },
        "Class2": {
            "SomePropertyOfClass2": "SomeValueOfClass2"
        }
    }

                    

Step 2 : Click Convert in order to start generating C# classes.

Click the convert button and wait a few seconds until your C# classes will generate or appear.

Step 3 : Copy the retuned C# classes from the second editor and deserialize using the 'Root' class.

When you copy the returned classes in the directory of your solution, you can deserialize your JSON response using the 'Root' class using any deserializer like Newtonsoft.

This is the response you'll get from the JSON request we made earlier:


    public class Awesomeobject {
        public int SomeProps1 { get; set; }
        public string SomeProps2 { get; set; }
    }

    public class User {
        public string id { get; set; }
        public string name { get; set; }
        public string created_at { get; set; }
        public string updated_at { get; set; }
        public string email { get; set; }
        public string testanadditionalfield { get; set; }
    }

    public class Class1 {
        public int id { get; set; }
        public string user_id { get; set; }
        public Awesomeobject awesomeobject { get; set; }
        public string created_at { get; set; }
        public string updated_at { get; set; }
        public List<user> users { get; set; }
    }

    public class Class2 {
        public string SomePropertyOfClass2 { get; set; }
    }

    public class Root {
        public Class1 Class1 { get; set; }
        public Class2 Class2 { get; set; }
    }


And this is how you deserialize it in your C# code:

                Root myDeserializedClass = JsonConvert.DeserializeObject(myJsonResponse);