How to get MAX value from Dictionary?

前端 未结 8 2257
独厮守ぢ
独厮守ぢ 2020-12-30 19:16

I have

Dictionary d = new Dictionary();

How I can get an Guid which has MAX

8条回答
  •  时光取名叫无心
    2020-12-30 19:40

    This works great. It will return the GUID for the MAX date.

    Dictionary d = new Dictionary(); 
    var guidForMaxDate = d.FirstOrDefault(x => x.Value == d.Values.Max()).Key;
    

提交回复
热议问题