Click here to Skip to main content
15,888,521 members
Home / Discussions / C#
   

C#

 
GeneralRe: Better Way to Search for a Value in a List of KeyValuePairs??? Pin
BillWoodruff7-Sep-11 19:37
professionalBillWoodruff7-Sep-11 19:37 
AnswerRe: Better Way to Search for a Value in a List of KeyValuePairs??? Pin
Dan Mos7-Sep-11 8:14
Dan Mos7-Sep-11 8:14 
GeneralRe: Better Way to Search for a Value in a List of KeyValuePairs??? Pin
NickPace7-Sep-11 9:12
NickPace7-Sep-11 9:12 
GeneralRe: Better Way to Search for a Value in a List of KeyValuePairs??? Pin
Matt U.7-Sep-11 11:02
Matt U.7-Sep-11 11:02 
GeneralRe: Better Way to Search for a Value in a List of KeyValuePairs??? Pin
NickPace7-Sep-11 12:42
NickPace7-Sep-11 12:42 
GeneralRe: Better Way to Search for a Value in a List of KeyValuePairs??? Pin
Matt U.7-Sep-11 13:12
Matt U.7-Sep-11 13:12 
QuestionRe: Better Way to Search for a Value in a List of KeyValuePairs??? Pin
MicroVirus8-Sep-11 4:34
MicroVirus8-Sep-11 4:34 
AnswerRe: Better Way to Search for a Value in a List of KeyValuePairs??? Pin
Abhinav S7-Sep-11 8:26
Abhinav S7-Sep-11 8:26 
You can always use LINQ.

If you want to search by the GUID (key) make your search criteria GUID.

IEnumerable result =  someList.Where(y=>y.Key.Contains(searchGUID));<br />

You can always search on the value as below.
IEnumerable result = someList.Where(y=>y.Value.Contains(searchString));

In both cases, result will contain the final search result.

Note that performance may or may not be better than using a loop.
LINQ makes it easier to write code, performance is generally better (but not always).
Too much of heaven can bring you underground
Heaven can always turn around
Too much of heaven, our life is all hell bound
Heaven, the kill that makes no sound

AnswerRe: Better Way to Search for a Value in a List of KeyValuePairs??? Pin
Ian Shlasko7-Sep-11 10:06
Ian Shlasko7-Sep-11 10:06 
AnswerRe: Better Way to Search for a Value in a List of KeyValuePairs??? Pin
PIEBALDconsult7-Sep-11 14:25
mvePIEBALDconsult7-Sep-11 14:25 
AnswerRe: Better Way to Search for a Value in a List of KeyValuePairs??? Pin
Mehdi Gholam7-Sep-11 20:05
Mehdi Gholam7-Sep-11 20:05 
AnswerRe: Better Way to Search for a Value in a List of KeyValuePairs??? [modified] Pin
BillWoodruff7-Sep-11 20:38
professionalBillWoodruff7-Sep-11 20:38 
GeneralRe: Better Way to Search for a Value in a List of KeyValuePairs??? Pin
NickPace8-Sep-11 3:40
NickPace8-Sep-11 3:40 
QuestionC#.net expiration date Pin
classy_dog7-Sep-11 5:30
classy_dog7-Sep-11 5:30 
AnswerRe: C#.net expiration date Pin
GParkings7-Sep-11 5:37
GParkings7-Sep-11 5:37 
GeneralRe: C#.net expiration date Pin
classy_dog7-Sep-11 5:51
classy_dog7-Sep-11 5:51 
GeneralRe: C#.net expiration date Pin
GParkings7-Sep-11 6:20
GParkings7-Sep-11 6:20 
GeneralRe: C#.net expiration date Pin
kribo9-Sep-11 5:01
professionalkribo9-Sep-11 5:01 
Questionout of memory ! Pin
mersad007-Sep-11 4:34
mersad007-Sep-11 4:34 
AnswerRe: out of memory ! Pin
GParkings7-Sep-11 4:45
GParkings7-Sep-11 4:45 
AnswerRe: out of memory ! Pin
Pete O'Hanlon7-Sep-11 5:01
mvePete O'Hanlon7-Sep-11 5:01 
AnswerRe: out of memory ! Pin
#realJSOP7-Sep-11 7:23
mve#realJSOP7-Sep-11 7:23 
AnswerRe: out of memory ! Pin
Daniel.Grondal7-Sep-11 22:43
Daniel.Grondal7-Sep-11 22:43 
QuestionThread.join Pin
benams7-Sep-11 0:28
benams7-Sep-11 0:28 
AnswerRe: Thread.join PinPopular
Pete O'Hanlon7-Sep-11 0:57
mvePete O'Hanlon7-Sep-11 0:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.