title: Equals not working on custom class
body: <p>I know that this question has been asked a few times for C#, I've gone through a few different examples, and starting to loose my mind.</p>
  
  <p>I have a custom class I'm using for a list and am attempting to compare two instances of it to determine if they are equal, and eventually look to see if there are duplicates (but first things first).</p>
  
  <p>Its a simple type class just holding a few string items. When I attempt to compare the two lists using either "==" or .Equals() it always returns false.
  The examples I have seen use the Equals override that seems to be coming from the same class. This is its own class, and I"m trying to compare them in a different class. I created a test project to to work on the Equals problem for simplicity. I have been checking against just one field to see if I can get it to work at all, with no luck. </p>
  
  <p>Oddly enough, even when setting break points anywhere in the either equals method, or gethashcode method. The debugger in VS 2015 does not stop the code, like the methods are not being called at all.</p>
  
  <p>If anyone could help with what i'm doing wrong, that would be great!</p>
  
  <pre><code>    class TagContainer : IEquatable&lt;TagContainer&gt;
        {
      public int idNo { get; set; }
      public string filePath { get; set; }
      public string artists { get; set; }
      public string album { get; set; }
      public string genre { get; set; }
      public string title { get; set; }
      public string year { get; set; }
  
      public TagContainer()
  
      {
          idNo = idNo;
          filePath = filePath;
          artists = artists;
          album = album;
          genre = genre;
          title = title;
          year = year;
      }
  
  
  
      public bool Equals(TagContainer obj)
      {
          if (obj == null) return false;
  
          return this.filePath.Equals(filePath);
      }
  
      public override bool Equals(Object obj)
      {
          if (ReferenceEquals(null, obj)) return false;
  
          if (ReferenceEquals(this, obj)) return true;
  
          if (obj.GetType() != GetType()) return false;
  
          TagContainer tc = (TagContainer)obj;
          return filePath == tc.filePath;
  
  
      }
  
      public override int GetHashCode()
      {
  
          unchecked
          {
              var hashCode = 13;
              var myStrHashCode = !string.IsNullOrEmpty(filePath) ?
                   filePath.GetHashCode() : 0;
              return hashCode * myStrHashCode;
          }
      }
  }
  </code></pre>
  
  <p>I also have test from that creates the lists and then checks to see if they are equal.</p>
  
  <pre><code>public partial class Form1 : Form
  {
      List&lt;TagContainer&gt; tc1 = new List&lt;TagContainer&gt;();
      List&lt;TagContainer&gt; tc2 = new List&lt;TagContainer&gt;();
  
      public Form1()
      {
          InitializeComponent();
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          addtoTC1();
          addtoTC2();
  
          textBox1.Text = tc1.Equals(tc2).ToString();
  
      }
  
      public void addtoTC1()
      {
          TagContainer tc = new TagContainer()
          {
              idNo = 1,
              filePath = "file1",
              artists = "artist 1",
              album = "album1",
              genre = "genre1",
              title = "title1",
              year = "2016"
          };
          tc1.Add(tc);
  
          TagContainer tg = new TagContainer()
          {
              idNo = 1,
              filePath = "file2",
              artists = "artist 2",
              album = "album2",
              genre = "genre2",
              title = "title2",
              year = "2016"
          };
  
          tc1.Add(tg);
  
      }
  
      public void addtoTC2()
      {
          TagContainer tc = new TagContainer()
          {
              idNo = 1,
              filePath = "file1",
              artists = "artist 1",
              album = "album1",
              genre = "genre1",
              title = "title1",
              year = "2016"
          };
          tc2.Add(tc);
  
          TagContainer tg = new TagContainer()
          {
              idNo = 1,
              filePath = "file2",
              artists = "artist 2",
              album = "album2",
              genre = "genre2",
              title = "title2",
              year = "2016"
          };
  
          tc2.Add(tg);
  
      }
  
  
  
  }
  </code></pre>