c# - How to select from List of KeyValuePair? -


i have list of keyvaluepair (key string type , value int type). , want return key value pair list matching criteria example : return list key = "a" , value = 10.

how select work on , how write expression required result ?

you can use linq expression so:

ilist<keyvaluepair<string, int>> values = new list<keyvaluepair<string, int>>(); 

add key values.

ilist<keyvaluepair<string, int>> result = values.where(v => v.key == "a" && v.value == 10).tolist(); 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -