I am trying to design a generic method, the method deals with a collection of say employees. The employee class has around 5 to 10 attributes. I want to be able to pass a filter and get back a (generic) a collection class EmployeeSummary with some of the attributes of the Employee class.
public T GetFilteredSubset<T>(Somecollection employeeList, filter)
The method must be able to apply the filter dynamically to this collection and return back a new projection of type T which would contain a subset of attributes of the parent class. I see other post about dynamically applying filters but unable to find any information on specifying the subset (is that even possible or am I going about this the wrong way). So for subset the caller will create a class whose attributes - name and type will match exactly those of the parent Employee class but only contain subset of attributes. The function needs to be able to apply the filter then based on the type T will return only those attributes to the caller.
Using VS 2010 , .Net 4.0, C# Thanks for your help / time