I need to output this json:
{
white: [0, 60],
green: [60, 1800],
yellow: [1800, 3000],
red: [3000, 0]
}
And I was trying to think on a model like:
public class Colors
{
public int[] white { get; set; }
public int[] green { get; set; }
public int[] yellow { get; set; }
public int[] red { get; set; }
}
But the property names could change, like maybe white can be now gray, etc.
Any clue?
Dictionary<string, int[]>? You wouldnt need that Colors class at all"wrapping your field names in JSON"white": [0, 60], "green": [60, 1800],etc. Other than that, you're looking for a simple dictionary like @maccettura commented.dynamic