Good way to get the key of the highest value of a Dictionary in C#

前端 未结 10 960
花落未央
花落未央 2020-12-04 17:33

I\'m trying to get the key of the maximum value in the Dictionary results.

This is what I have so far:

double max          


        
10条回答
  •  感情败类
    2020-12-04 17:48

    Check These out:

    result.Where(x=>x.Value==result.Values.Max()).Select(x=>x.Key).ToList()

提交回复
热议问题