In C# I have an object with a name and surname property and have created a list of these objects, List<person>
.
I'd like to filter this List<person>
basing it on a name and a surname, but in the list some person can have surname null, so I'd like to filter for name only if name is not null and for surname only if it's not null.
I'm not able to do it with findall, cause it accepts only a predicate
m_cPersons.FindAll(q => q.Name != null && q.Name.ToUpper().Contains(name));
How can I add two predicates?