I have a situation where I would need a dictionary with this type of key, but it doesn't seem to find the equivalent key later on.
Dictionary<Tuple<int[], int>, object> cache = new Dictionary<Tuple<int[], int>, object>();
cache.Add(Tuple.Create(new int[]{1}, 1), new object());
Assert.That(cache.ContainsKey(Tuple.Create(new int[] { 1 }, 1))); // This fails
I've tested it by using a Tuple<int, int>
and it seems to be working fine, but in my case I really need some sort of Tuple<int[], int>
and with that type of key, it doesn't work.
Is there any other alternative to this that would be working?