This is a free json to c# converter which converts the json objects into a class in c#.
Copy the JSON object inside the first code editor.
Make sure that the JSON string is well formatted. The JSON object should be wrapped with curly braces and should not be escaped by backslashes.
Click Convert button in order to start generating C# classes.
Click the convert button and wait a few seconds until your C# classes appear.
Copy the retuned C# classes from the second part. When you copy the returned classes in the directory of your solution, you can deserialize your JSON response using the 'RootObject' class using any deserializer like Newtonsoft.
This is the response you'll get from the JSON request we made earlier:
public class RootObject
{
public Class11 Class11 { get; set; }
public Class12 Class12 { get; set; }
}
public class Awesomeobject
{
public int Someprops1 { get; set; }
public string Someprops2 { get; set; }
}
public class Users
{
public string Id { get; set; }
public string Name { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
public string Email { get; set; }
}
public class Class11
{
public int Id { get; set; }
public string UserId { get; set; }
public Awesomeobject Awesomeobject { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
public List<Users> Users { get; set; }
}
public class Class12
{
public string Somepropertyofclass12 { get; set; }
}
How to Save input/output in "Json to C# Classes" converter?
It's very easy to save input/output, just press "Save" button and it will be save and redirected to unique url.
How to Share saved input/output in "Json to C# Classes" converter?
It's very easy to share saved input/output, just press "Share" button, a popup window will be opened. Press "Copy" and current url will be copied to clipboard.