Below is an extract from a json response received from a service.
aggregations: {
gender: {
...other data
}
}
The service will return same structure every time but with different aggregation type based on some parameters. So the term "gender" can be "age" or "city" or anything else. I am looking for a way to create a .Net object, is possible, with a dynamic property name so that I don't need to have separate object for each aggregation. something like this:
public class Aggregation {
[JsonProperty(PropertyName = "<dynamic value based on json response>")]
public List<string> AggregationValues { get; set; }
}
Is there any other way to achieve this? Thank you for your help.