This is a bit of noob question - I\'m still fairly new to C# and generics and completely new to predicates, delegates and lambda expressions...
I have a class \'Enqu
A predicate in T is a delegate that takes in a T and returns a bool. List
{
List vehicles;
// Using a lambda
vehicles.RemoveAll(vehicle => vehicle.EnquiryID == 123);
// Using an equivalent anonymous method
vehicles.RemoveAll(delegate(Vehicle vehicle)
{
return vehicle.EnquiryID == 123;
});
// Using an equivalent actual method
vehicles.RemoveAll(VehiclePredicate);
}
private static bool VehiclePredicate(Vehicle vehicle)
{
return vehicle.EnquiryID == 123;
}