title: C# equivalent of std::sort and std::unique
body: <p>I have a list of integers in C#. I wish to remove duplicates. 
  In C++ I would run it through the std::sort and then std::unique algorithms for a very efficient way of obtaining the unique list.</p>
  
  <p>What's the best way to do the same thing in C#? In other words, I'm looking for a more elegant way to do the following code:</p>
  
  <pre><code>    private static int[] unique(int[] ids)
      {
          IDictionary&lt;int, object&gt; d = new Dictionary&lt;int, object&gt;();
          foreach(int i in ids)
              d[i] = null;
  
          int[] results = new int[d.Count];
          int j = 0;
          foreach(int id in d.Keys)
              results[j++] = id;
  
          return results;
      }
  </code></pre>