title: Trying to implement a method that can compare any two lists but it always returns false
body: <p>I'm trying to make a method that can compare any two lists for equality. I'm trying to compare them in a way that validates that every element of one list has the same value as every element of another list. My <code>Equals</code> method below always returns <code>false</code>, can anyone see why that is?</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  public class IEnumerableComparer&lt;T&gt; : IEqualityComparer&lt;IEnumerable&lt;T&gt;&gt;
  {
      public bool Equals(IEnumerable&lt;T&gt; x, IEnumerable&lt;T&gt; y)
      {
          for(int i = 0; i&lt;x.Count();i++){
            if(!Object.Equals(x.ElementAt(i), y.ElementAt(i))){
               return false;
            }
          }
          return true;
      }
  
      public int GetHashCode(IEnumerable&lt;T&gt; obj)
      {
          if (obj == null)
              return 0;
  
          return unchecked(obj
              .Select(e =&gt; e.GetHashCode())
              .Aggregate(0, (a, b) =&gt; a + b)); 
      }
  }
  </code></pre>
  
  <p>Here is my data I'm using to test this <code>Equals</code> method:</p>
  
  <pre><code> static void Main(string[] args)
          {
              Car car1 = new Car();
              car1.make = "Toyota";
              car1.model = "xB";
  
              Car car2 = new Car();
              car2.make = "Toyota";
              car2.model = "xB";
  
              List&lt;Car&gt; l1 = new List&lt;Car&gt;();
              List&lt;Car&gt; l2 = new List&lt;Car&gt;();
              l1.Add(car1);
              l2.Add(car2);
  
             IEnumerableComparer&lt;Car&gt; seq = new IEnumerableComparer&lt;Car&gt;();
  
             bool b = seq.Equals(l1, l2);
  
             Console.Write(b); //always says false
             Console.Read();
          }
      }
  </code></pre>
  
  <p>Car class:</p>
  
  <pre><code>   class Car
      {
          public String make { get; set; }
          public String model { get; set; }
      }
  </code></pre>