I am using a generic list in my program to have a list of objects stored. I want to compare all the objects in this list with object of another class and find all the objects which meet the criteria. To make it more specific I have a class Employee and a class Salary which look like
Employee { Name Salary Age Id}
Salary{ Currency Amount}
Now i am having a List
public bool IsGreaterThen2000(Employee obj)
{ //some logic return true/false;}
and then pass this as predicate to FindAll method however the responsibility of comparison lies with Salary class. I want to shift this responsibility to some other class which already has the logic for comparison. Is there a way to achieve this using existing generic List class in .NET framework.
Any good ideas out there to solve this with .NET framework 2.0 ?????
~Abhishek