IEquatable<T>.Equals from MSDN
<p>I'm looking at <a href="https://msdn.microsoft.com/en-us/library/ms131190(v=vs.110).aspx" rel="nofollow">IEquatable.Equals on MSDN</a>.  Specifically the section for the two Equals operators:</p>

<pre><code>public override bool Equals(Object obj)
{
   if (obj == null)
      return false;

   Person personObj = obj as Person;
   if (personObj == null)
      return false;
   else
      return Equals(personObj);
}

public static bool operator == (Person person1, Person person2)
{
   if (((object)person1) == null || ((object)person2) == null)
      return Object.Equals(person1, person2);

   return person1.Equals(person2);
}
</code></pre>

<p>The line I'm struggling with is:</p>

<pre><code>if (((object)person1) == null || ((object)person2) == null)
   return Object.Equals(person1, person2);
</code></pre>

<ol>
<li>Why the cast to object before checking if it's null? Is there more to it or could it just as easily been expressed <code>if ( person1 == null || person2 == null )</code>?</li>
<li>Why the call to Object.Equals?  Surely if one of the items is null then it's <code>false</code>?</li>
</ol>

<p>The way I see it, </p>

<pre><code>if (((object)person1) == null || ((object)person2) == null)
   return Object.Equals(person1, person2);
</code></pre>

<p>is just a convoluted way of writing:</p>

<pre><code>if ( person1 == null || person2 == null )
   return false;
</code></pre>

<p>or am I missing something?</p>