Solved

.NET,C#:List<T> contains for lookup custom objects

Posted on 2008-10-17
5
3,140 Views
Last Modified: 2013-12-17
Does any one know how I can take advantage of the Contains() method of a generic List class to look up whether my collection of custom objects contains a specific element?
0
Comment
Question by:karakav
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:divyeshhdoshi
ID: 22738884
This method will return true(bool) if specified element is available in list , False otherwise



0
 
LVL 4

Author Comment

by:karakav
ID: 22738975
Yeah, I know that. My question is that the Contains methods does not know how to compare my custom objects.
0
 
LVL 13

Expert Comment

by:crazyman
ID: 22739114
0
 
LVL 13

Accepted Solution

by:
crazyman earned 500 total points
ID: 22739138
Ooops misread the question, ignore that...

this may be more help

http://forums.asp.net/t/1088225.aspx
0
 
LVL 4

Author Closing Comment

by:karakav
ID: 31507075
Thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to remove duplicate code from my project 5 50
How to repeat the data 4 30
Calculating percentage 2 35
How to set focus on a dynamic control 18 29
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question