So here's the important bits, I have a dictionary with a key and value
public Dictionary<int, string> MyDictionary = new Dictionary<int, string>();
I can add to it with...
SomeClass.MyDictionary.Add(intValue, stringValue);
I can search the dictionary and retrieve stringValue with...
if (SomeClass.MyDictionary.ContainsKey(intValue))
{
string DictValues;
SomeClass.MyDictionary.TryGetValues(intValue, out DictValues);
}
My problem now is that I need something that can contain two keys, that I can search for independent of each other.
This is wrong, but I'm looking for something like
public Dictionary<int, int, string> MyDictionary = new Dictionary<int, int, string>();
SomeClass.MyDictionary.Add(intValue1, intValue2, stringValue);
When i run
SomeClass.MyDictionary.ContainsKey(intValue)
I want search both intValue1 and intValue2 independently of each other. Basically i need to know if intValue1 OR intValue2 exists in this "dictionary" so hashing them together to see if both exist isn't an option. Using a tuple is not an option because I can't use the Add() function (maybe there's another way to add to tuples? unlikely).
I tried to use an Arraylist but they only store a single object. So I thought I could put a Tuple inside but then i can't search for individual tuple items.
I would like to avoid using two dictionaries as intValue1 and intValue2 are also a key, value pair. I need to know that intValue1 and intValue2 are related. intValue2 could be another key, and it some instances it could be a value that i need.