QueryFilter 类
此类包含谓词过滤器值。
public class QueryFilter
{
public string PropertyName { get; set; }
public string Value { get; set; }
public Operator Operator { get; set; }
// In the query {a => a.Name.Equals("Pedro")}
// Property name to filter - propertyName = "Name"
// Filter value - value = "Pedro"
// Operation to perform - operation = enum Operator.Equals
public QueryFilter(string propertyName, string value, Operator operatorValue)
{
PropertyName = propertyName;
Value = value;
Operator = operatorValue;
}
}
枚举以保存操作值:
public enum Operator
{
Contains,
GreaterThan,
GreaterThanOrEqual,
LessThan,
LessThanOrEqualTo,
StartsWith,
EndsWith,
Equals,
NotEqual
}