title: How to calculate rank from list of integer?
body: <p>In database(SQL Server), say, one column values are like:</p>
  
  <pre><code>Col1
  ====
  10
  5
  15
  20
  5
  10
  2
  </code></pre>
  
  <p>This is like list of integer data.</p>
  
  <p>Rank should be:</p>
  
  <pre><code>Col1 Rank
  ==== ====
  20    1
  15    2
  10    3
  10    3
  5     4
  5     4
  2     5
  </code></pre>
  
  <p>I have tried in following manner:</p>
  
  <pre><code>1) First sort the list of data in descending order of "Col1" value
  2) Find the index of a particular record using FindIndex() method.
  3) Then Rank = Index + 1
  </code></pre>
  
  <p>But it will only work if the data are unique. It fails when same "Col1" values are present in multiple rows as the index is returning <code>0, 1, 2, 3, 4, 5, 6</code>. </p>
  
  <p>How to calculate the rank when the list contains data which are not distinct(in most cases!) using C# LINQ?</p>