I have a json
"1593263898657":{"id":1593263898657,"timeToday":[17,0],"name"= "ABCD"},
"1593263898700":{"id":1593263898700,"timeToday":[17,0],"name"= "ABCD"}"
The class of the json is known to me i.e
public class BaseClass
{
public long id { get; set; }
public List<int> timeToday { get; set; }
public string name { get; set; }
}
public class Root
{
[JsonProperty("1593263898657")]
public BaseClass B1 { get; set; }
[JsonProperty("1593263898700")]
public BaseClass B2 { get; set; }
}
var myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse);
but the problem is while deserializing I don't know how many json property will be there in Root class, so I need to generate the json property dynamically, how can I do that?
Eg: Root class may contain B3,B4... respectively so I do not want to hardcode!