always returns a boolean
Main logic
ShowGrade("");
Method using predicate
static void ShowGrade(string name)
{
//Predicate logic
var found = employees.Find(predicate);
Console.WriteLine("{0}'s Grade: {1}", found.Name, found.Score);
}
Predicate Method
static bool predicate(Employee employee)
{
//can return the condition instead of doing evail with if/then
return (employee.Name == "Jones");
//if (employee.Name == "Jones")
// return true;
//else
// return false;
}
- Log in to post comments
Tags
