title: OrderBy ignoring accented letters
body: <p>I want a method like <code>OrderBy()</code> that always orders ignoring accented letters and to look at them like non-accented. I already tried to override <code>OrderBy()</code> but seems I can't do that because that is a static method.</p>
  
  <p>So now I want to create a custom lambda expression for <code>OrderBy()</code>, like this:</p>
  
  <pre><code>public static IOrderedEnumerable&lt;TSource&gt; ToOrderBy&lt;TSource, TKey&gt;(
      this IEnumerable&lt;TSource&gt; source, Func&lt;TSource, TKey&gt; keySelector)
  {
      if(source == null)
          return null;
  
      var seenKeys = new HashSet&lt;TKey&gt;();
  
      var culture = new CultureInfo("pt-PT");
      return source.OrderBy(element =&gt; seenKeys.Add(keySelector(element)), 
                            StringComparer.Create(culture, false));
  } 
  </code></pre>
  
  <p>However, I'm getting this error:</p>
  
  <blockquote>
    <p>Error 2   The type arguments for method
    'System.Linq.Enumerable.OrderBy&lt;TSource,TKey>(System.Collections.Generic.IEnumerable&lt;TSource>,
    System.Func&lt;TSource,TKey>,
    System.Collections.Generic.IComparer&lt;TKey>)' cannot be inferred from
    the usage. Try specifying the type arguments explicitly.</p>
  </blockquote>
  
  <p>Seems it doesn't like <code>StringComparer</code>. How can I solve this?   </p>
  
  <p><strong>Note:</strong></p>
  
  <p>I already tried to use <code>RemoveDiacritics()</code> from <a href="https://stackoverflow.com/questions/359827/ignoring-accented-letters-in-string-comparison">here</a> but I don't know how to use that method in this case. So I tried to do something like <a href="https://stackoverflow.com/questions/7229445/orderby-with-swedish-letters">this</a> which seems nice too.</p>