I have a List<B> and class B has a public property A.
How can I filter the list of B using a Predicate<A>?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your list is named myList and your predicate myPredicate, then you want probably something like this:
or you can use a lambda expression, e.g.:
or something like this, where the predicate would be
b.A < 10.Maybe you should give us a more complete code sample.