I\'m trying to use JSON.Net to deserialize a JSON object into a C# object.
The object I want to create is MonthlyPerformance
which contains a list of
Your property names do not match that of your JSON. I would expect the serialization to fail.
Given the JSON you posted I would expect your c# classes to look like this. I'm not familiar with JSON.net but I would assume they have a property decorator that would allow you to specify the name of the JSON property the c# prop matches too.
public class MonthlyPerformance
{
public List Type { get; set; }
}
public class Type
{
public int id { get; set; }
public string countryId { get; set; }
public string Name { get; set; }
public List Category { get; set; }
public Type()
{
}
}
public class Category
{
public int id { get; set; }
public string countryId { get; set; }
public string name { get; set; }
public List ConfigurationFund{ get; set; }
public Category()
{
}
}
public class Fund
{
public int id { get; set; }
public string countryId { get; set; }
public string name { get; set; }
public Fund()
{
}
}