The default for KeyValuePair

后端 未结 7 636
悲哀的现实
悲哀的现实 2020-12-04 10:01

I have an object of the type IEnumerable> keyValueList, I am using

 var getResult= keyValueList.SingleOrDefault()         


        
相关标签:
7条回答
  • 2020-12-04 10:52

    To avoid the boxing of KeyValuePair.Equals(object) you can use a ValueTuple.

    if ((getResult.Key, getResult.Value) == default)
    
    0 讨论(0)
提交回复
热议问题