Let\'s say we have a collection of Person objects
class Person
{
public string PersonName {get;set;}
public string PersonAddress {get;set;}
}
You can do it via reflection:
IQueryable filteredPersons = personsList.AsQueryable();
Type personType = typeof(Person);
foreach(Filter filter in userFilters) {
filteredPersons = filteredPersons.Where(p => (string)personType.InvokeMember(filter.FieldName, BindingFlags.GetProperty, null, p, null) == filter.FilterString);
}
(not compiled, but this should be along the right track)