I would like to see some of your suggestions on how to build entities in C# to fit this Json
{
"activities-heart": [
{
"dateTime": "2016-10-25",
"value": {
"customHeartRateZones": [],
"heartRateZones": [
{
"max": 88,
"min": 30,
"name": "Out of Range"
},
{
"max": 123,
"min": 88,
"name": "Fat Burn"
},
{
"max": 150,
"min": 123,
"name": "Cardio"
},
{
"max": 220,
"min": 150,
"name": "Peak"
}
]
}
}
],
"activities-heart-intraday": {
"dataset": [],
"datasetInterval": 1,
"datasetType": "minute"
}
}
This Site suggested:
public class HeartRateZone
{
public int max { get; set; }
public int min { get; set; }
public string name { get; set; }
}
public class Value
{
public List<object> customHeartRateZones { get; set; }
public List<HeartRateZone> heartRateZones { get; set; }
}
public class ActivitiesHeart
{
public string dateTime { get; set; }
public Value value { get; set; }
}
public class ActivitiesHeartIntraday
{
public List<object> dataset { get; set; }
public int datasetInterval { get; set; }
public string datasetType { get; set; }
}
public class RootObject
{
public List<ActivitiesHeart> __invalid_name__activities-heart { get; set; }
public ActivitiesHeartIntraday __invalid_name__activities-heart-intraday { get; set; }
}
My problem is that this returns nothing, it tries to build the entities but they are null. Is there something that the converter and i don't see.