I am trying to create dynamic predicate so that it can be used against a list for filtering
public class Feature
{
public string Color{get;set;}
publ
public Predicate GetFilter(
Expression> property,
T value,
string condition)
{
switch (condition)
{
case ">=":
return
Expression.Lambda>(
Expression.GreaterThanOrEqual(
property.Body,
Expression.Constant(value)
),
property.Parameters
).Compile();
default:
throw new NotSupportedException();
}
}
Any questions? :-)