title: Why is there no Linq method to return distinct values by a predicate?
body: <p>I want to get the distinct values in a list, but not by the standard equality comparison.</p>
  
  <p>What I want to do is something like this:</p>
  
  <pre><code>return myList.Distinct( (x, y) =&gt; x.Url == y.Url );
  </code></pre>
  
  <p>I can't, there's no extension method in Linq that will do this - just one that takes an <code>IEqualityComparer</code>.</p>
  
  <p>I can hack around it with this:</p>
  
  <pre><code>return myList.GroupBy( x =&gt; x.Url ).Select( g =&gt; g.First() );
  </code></pre>
  
  <p>But that seems messy. It also doesn't quite do the same thing - I can only use it here because I have a single key.</p>
  
  <p>I could also add my own:</p>
  
  <pre><code>public static IEnumerable&lt;T&gt; Distinct&lt;T&gt;( 
      this IEnumerable&lt;T&gt; input, Func&lt;T,T,bool&gt; compare )
  {
      //write my own here
  }
  </code></pre>
  
  <p>But that does seem rather like writing something that should be there in the first place.</p>
  
  <p>Anyone know why this method isn't there?</p>
  
  <p>Am I missing something?</p>