title: Implementing IEquatable<T> to avoid duplicates from List<T>
body: <p>I have a <code>List&lt;CustomObject&gt;</code> and want to remove duplicates from it.<br /> 
  If two Custom Objects have same value for <code>property: City</code>, then I will call them duplicate.<br />
  I have implemented IEquatable as follows, but not able to remove duplicates from the list.   </p>
  
  <p>What is missing?</p>
  
  <pre><code> public class CustomAddress : IAddress, IEqualityComparer&lt;IAddress&gt;
   {
      //Other class members go here
  
      //IEqualityComparer members
      public bool Equals(IAddress x, IAddress y)
      {
          // Check whether the compared objects reference the same data.
          if (ReferenceEquals(x, y)) return true;
  
          // Check whether any of the compared objects is null.
          if (ReferenceEquals(x, null) || ReferenceEquals(y, null))
              return false;
  
          // Check whether the Objects' properties are equal.
          return x.City.Equals(y.City);
  
      }
  
      public int GetHashCode(IAddress obj)
      {
          // Check whether the object is null.
          if (ReferenceEquals(obj, null)) return 0;
  
          int hashAreaName = City == null ? 0 : City.GetHashCode();
          return hashAreaName;
      }
   }
  </code></pre>
  
  <p>I am using .NET 3.5 </p>