title: Dictionary class in C# - Equality of two object
body: <p>I have a class named Class1
  I override its Equals function
  Now I have an instance of Dictionary
  And I added an instance of Class1 named OBJ1 to it.
  I have another instance of Class1 named OBJ2.
  the code returns true for OBJ1.Equals(OBJ2).
  But I can't find OBJ2 in dictionary.</p>
  
  <p>Here is pseudo code</p>
  
  <pre><code>Class1 OBJ1 = new Class1(x, y, z);
  Class1 OBJ2 = new Class1(a, b, c);
  Dictionary&lt;Class1, int&gt; dic1 = new Dictionary&lt;Class1, int&gt;();
  dic1.Add(OBJ1, 3);
  OBJ1.Equals(OBJ2) -------------&gt; return true
  Dictionary.ContainsKey(OBJ2) --------------&gt; return false
  </code></pre>
  
  <p>why is this happening?
  any help would be highly welcomed</p>