title: C# - using List<T>.Find() with custom objects
body: <p>I'm trying to use a <code>List&lt;T&gt;</code> with a custom class of mine, and being able to use methods like <code>Contains()</code>, <code>Find()</code>, etc., on the list. I thought I'd just have to overload the operator <code>==</code> but apparently, one way of doing that is to use a delegate method with the <code>Find()</code>...</p>
  
  <p>Note: Right now, I've overloaded the <code>Equals()</code> method to get the <code>Contains()</code> method to work, but I still couldn't get the <code>Find()</code> function to work.</p>
  
  <p>What would be the best way of getting both to work?</p>
  
  <p>I'm using the latest C# /.NET framework version with mono, on linux.</p>
  
  <p>edit: Here's my code</p>
  
  <pre><code>using System;
  namespace GuerreDesClans
  {
  public class Reponse : IEquatable&lt;Reponse&gt;
  {
      public Reponse ()
      {
          m_statement = string.Empty;
          m_pointage = 0;
      }
  
      public Reponse (string statement, int pointage)
      {
          m_pointage = pointage;
          m_statement = statement;
      }
  
  
      /*
       * attributs privés
       */
  
      private string m_statement;
      private int m_pointage;
  
  
      /*
       * properties
       */
  
      public string Statement {
          get { return m_statement; }
          set { m_statement = value; }
      }
  
      public int Pointage {
          get { return m_pointage; }
          set { m_pointage = value; }
      }
  
      /*
       * Equatable
       */
  
      public bool Equals (Reponse other)
      {
          if (this.m_statement == other.m_statement)
              return true;
          else
              return false;
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and how I would like to search my Reponse objects using the find() function...</p>
  
  <pre><code>list.find("statement1"); // would return a Reponse object
  </code></pre>