title: C#: best practice to overload == operator when it comes to null references
body: <p>what is the best practice to overload == operator that compares two instances of the same class when it comes to null reference comparison?</p>
  
  <pre><code>MyObject o1 = null;
  MyObject o2 = null;
  if (o1 == o2) ... 
  
  
  static bool operator == (MyClass o1, MyClass o2)
  {
    // ooops! this way leads toward recursion with stackoverflow as the result
    if (o1 == null &amp;&amp; o2 == null) 
      return true;   
  
    // it works!
    if (Equals(o1, null) &amp;&amp; Equals(o2, null))
      return true;
  
    ... 
  }
  </code></pre>
  
  <p>What is the best approach to handle null references in comparison ? </p>