Click here to Skip to main content
14,928,926 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I want to use Find() and Sort() methods of LIST< T > , but I don't know how.
Can I use Find method for finding an object in LIST which has a specific Property? (I've declared a LIST of my objects)

1 solution

Yes, pass it a predicate that checks the property to see if it is a match. Or, if you are looking for the actual property rather than its value, you can use reflection on the objects (in the predicate) to check if that property exists.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900