public override FilteringExpression ToFilteringExpression(ParameterExpression parameterExpression) { var filteringExpressions = Filters.Select(x => x.ToFilteringExpression(parameterExpression)).ToList(); FilteringExpression filteringExpression = null; foreach (var currentExpression in filteringExpressions) { if (filteringExpression == null) { filteringExpression = currentExpression; continue; } filteringExpression = filteringExpression.ConnectTo(currentExpression); } return(filteringExpression.WithLogicalConnection(LogicalConnection.GetExpression())); }
public SimpleFilter(LogicalConnection logicalConnection, string propertyName, FilteringOperator filteringOperator, object searchValue) { if (string.IsNullOrWhiteSpace(propertyName)) { throw new ArgumentException($"{propertyName} can not be empty", nameof(propertyName)); } if (filteringOperator == null) { throw new ArgumentNullException(nameof(filteringOperator)); } if (logicalConnection == null) { throw new ArgumentNullException(nameof(logicalConnection)); } PropertyName = propertyName; Operator = filteringOperator; SearchValue = searchValue; LogicalConnection = logicalConnection; }
public abstract Filter WithLogicalConnection(LogicalConnection logicalConnection);
public override Filter WithLogicalConnection(LogicalConnection logicalConnection) { return(new ScopedFilter(logicalConnection, Filters.ToArray())); }
public ScopedFilter(LogicalConnection logicalConnection, params Filter[] filters) { LogicalConnection = logicalConnection; Filters = filters; }
public override Filter WithLogicalConnection(LogicalConnection logicalConnection) { return(new SimpleFilter(logicalConnection, PropertyName, Operator, SearchValue)); }