how to do a dictionary reverse lookup

前端 未结 5 1525
悲哀的现实
悲哀的现实 2021-02-05 04:23

I have a dictionary of type and for a particular case, I need to do a reverse lookup. So for instance suppose I have this entry <\"S

5条回答
  •  走了就别回头了
    2021-02-05 05:20

    How about using the linq function ToDictionary:

    var reversedDictionary = dictionary.ToDictionary(x => x.Value, x => x.Key);
    

提交回复
热议问题