I have the below SQL statement that works as desired/expected. However I would like to translate it into a LINQ statement(Lambda??) so that it will fit with the rest of my
Based on answer from @Totero but with a lamda implementation. Higher score = higher rank.
var rankedData = data.Select(s => new{
Ranking = data.Count(x => x.Value > s.Value)+1,
Name = s.Key,
Score = s.Value});
For this input:
{ 100, 100, 98, 97, 97, 97, 91, 50 }
You will get this output: