title: Distinct not working with LINQ to Objects
body: <pre><code>class Program
  {
      static void Main(string[] args)
      {
          List&lt;Book&gt; books = new List&lt;Book&gt; 
          {
              new Book
              {
                  Name="C# in Depth",
                  Authors = new List&lt;Author&gt;
                  {
                      new Author 
                      {
                          FirstName = "Jon", LastName="Skeet"
                      },
                       new Author 
                      {
                          FirstName = "Jon", LastName="Skeet"
                      },                       
                  }
              },
              new Book
              {
                  Name="LINQ in Action",
                  Authors = new List&lt;Author&gt;
                  {
                      new Author 
                      {
                          FirstName = "Fabrice", LastName="Marguerie"
                      },
                       new Author 
                      {
                          FirstName = "Steve", LastName="Eichert"
                      },
                       new Author 
                      {
                          FirstName = "Jim", LastName="Wooley"
                      },
                  }
              },
          };
  
  
          var temp = books.SelectMany(book =&gt; book.Authors).Distinct();
          foreach (var author in temp)
          {
              Console.WriteLine(author.FirstName + " " + author.LastName);
          }
  
          Console.Read();
      }
  
  }
  public class Book
  {
      public string Name { get; set; }
      public List&lt;Author&gt; Authors { get; set; }
  }
  public class Author
  {
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public override bool Equals(object obj)
      {
          return true;
          //if (obj.GetType() != typeof(Author)) return false;
          //else return ((Author)obj).FirstName == this.FirstName &amp;&amp; ((Author)obj).FirstName == this.LastName;
      }
  
  }
  </code></pre>
  
  <p>This is based on an example in "LINQ in Action". Listing 4.16.</p>
  
  <p>This prints Jon Skeet twice. Why? I have even tried overriding Equals method in Author class. Still Distinct does not seem to work. What am I missing?</p>
  
  <p>Edit:
  I have added == and != operator overload too. Still no help.</p>
  
  <pre><code> public static bool operator ==(Author a, Author b)
      {
          return true;
      }
      public static bool operator !=(Author a, Author b)
      {
          return false;
      }
  </code></pre>