Windows Forms App to generate a C# class file from given JSON data
When we use many APIS hosted in service providers, we come across situations where the output from the APIs is usually in JSON format. To use these in our C# prograns easily, we manually create a class definition in C#. This utility does it for you.
Sample Input
{
"DateX": "2024-01-03",
"CompareSymbol": "BEP",
"ComparePrice": 25.65,
"CompareYield": 5.5361,
"HoldSymbol": "BNJ",
"HoldPrice": 15.72,
"HoldYield": 7.1565,
"Spread": -1.6204,
"zScore": -0.7848
}
Sample Output
public class cTest
{
public string DateX { get; set; }= string.Empty;
public string CompareSymbol { get; set; }= string.Empty;
public double ComparePrice { get; set; }= 0;
public double CompareYield { get; set; }= 0;
public string HoldSymbol { get; set; }= string.Empty;
public double HoldPrice { get; set; }= 0;
public double HoldYield { get; set; }= 0;
public double Spread { get; set; }= 0;
public double zScore { get; set; }= 0;
}