title: Custom Equals Method in C#
body: <p>I wrote a class called <code>baseCommodity</code> and it includes a customized <code>Equals</code> method:</p>
  
  <pre><code>public override bool Equals(object obj)
  {
      BaseCommodity other = obj as BaseCommodity;
      return other != null &amp;&amp; other.GetType() is this.GetType());
  }
  </code></pre>
  
  <p>I want to compare the <code>other.GetType()</code> with the Type of <code>this</code> class but <code>is this.GetType()</code> does not work. I keep getting the error "Unexpected symbol <code>this', expecting</code>type'"</p>