What is a predicate in c#? [duplicate]
This question already has an answer here: Predicate Delegates in C# 9 answers I am very new to using predicates and just learned how to write: Predicate<int> pre = delegate(int a){ a %2 == 0 }; What will the predicate return, and how is it useful when programming? Predicate<T> is a functional construct providing a convenient way of basically testing if something is true of a given T object. For example suppose I have a class: class Person { public string Name { get; set; } public int Age { get; set; } } Now let's say I have a List<Person> people and I want to know if there's anyone named Oscar