1

I have a Dictionary set up as follows:

public Dictionary<int, Tuple<HashSet<string>, HashSet<string>>> tests =
    new Dictionary<int, Tuple<HashSet<string>, HashSet<string>>>()
{
    {-1, Tuple.Create(new HashSet<string>(),new HashSet<string>()) },
    {-2, Tuple.Create(new HashSet<string>(),new HashSet<string>()) }
};

I update it and ultimately deserialize into JSON. The result is something like this

"tests": {
    "-1": {
      "Item1": [],
      "Item2": [ "a", "b", "c", "d"]
    },
    "-2": {
      "Item1": ["f", "g"],
      "Item2": []
    },

Is it possible for me to replace "Item1" and "Item2" with something else? In my case the category name

elmer007
  • 1,412
  • 14
  • 27
James Raitsev
  • 92,517
  • 154
  • 335
  • 470
  • 1
    You can't change those names, just create your own type and store the values there instead of using a tuple. – Tal Feb 12 '20 at 16:04

0 Answers0