title: Custom Class used as key in Dictionary but key not found
body: <p>I have a class, show below, which is used as a key in a <code>Dictionary&lt;ValuesAandB, string&gt;</code>
  I'm having issues when trying to find any key within this dictionary, it never finds it at all. As you can see, I have overridden <code>Equals</code> and <code>GetHashCode</code>.</p>
  
  <p>To look for the key I'm using</p>
  
  <pre><code>ValuesAandB key = new ValuesAandB(A,B);
  if (DictionaryName.ContainsKey(key)) {
     ...
  }
  </code></pre>
  
  <p>Is there anything else that I'm missing? Can anyone point out what I'm doing wrong?</p>
  
  <pre><code>private class ValuesAandB {
     public string valueA;
     public string valueB;
  
     // Constructor
     public ValuesAandB (string valueAIn, string valueBIn) {
       valueA = valueAIn;
       valueB = ValueBIn;
     }
  
     public class EqualityComparer : IEqualityComparer&lt;ValuesAandB&gt; {
        public bool Equals(ValuesAandB x, ValuesAandB y) {
           return ((x.valueA.Equals(y.valueA)) &amp;&amp; (x.valueB.Equals(y.valueB)));
        }
        public int GetHashCode(ValuesAandB x) {
           return x.valueA.GetHashCode() ^ x.valueB.GetHashCode();
        }
     }
  }
  </code></pre>
  
  <p>And before anyone asks, yes the values are in the Dictionary!</p>