title: How to use IList.Contains() method to find an object
body: <p>I have a list of Persons inside a Company Class.</p>
  
  <pre><code>public class Company{
      IList&lt;Person&gt; persons;
  }
  </code></pre>
  
  <p>Then I have a List of companies,</p>
  
  <pre><code>IList&lt;Company&gt; companies;
  </code></pre>
  
  <p>Now I have a name (say "Lasantha"). If this name is a part of the name of any person in a company, I want to find that company. I tried using companies.Contains() method. I overrided the object.Equals method, inside the Person class as this,</p>
  
  <pre><code>public override bool Equals(object o)
          {
              var other = o as Person;
              return this.Name.ToLower().Contains(other.Name.ToLower());
          }
  </code></pre>
  
  <p>But this is not working. It's not calling this Equal method as well. Can someone help me please.</p>
  
  <p>Thank you.</p>