Get the index of item in list based on value
问题 The scenario is for a football league table. I can order the list by match win percentage and then by goals scored to determine their position in the league. I then use this ordering to get teams position in the league table using the IndexOf function. this.results = this.results.OrderByDescending(x => x.WinPercentage).ThenByDescending(x => x.Goals); this.results.Foreach(x => x.Position = this.results.IndexOf(x)); The problem arises when two teams (should be joint #1) have the same match win