public override Expression HandleOperation( QueryableFilterContext context, IFilterOperationField field, IValueNode value, object parsedValue) { if (context.RuntimeTypes.Count > 0 && context.RuntimeTypes.Peek().TypeArguments is { Count : > 0 } args&& parsedValue is bool parsedBool) { Expression?property = context.GetInstance(); Expression expression; if (parsedBool) { expression = FilterExpressionBuilder.Any(args[0].Source, property); } else { expression = FilterExpressionBuilder.Not( FilterExpressionBuilder.Any(args[0].Source, property)); } if (context.InMemory) { expression = FilterExpressionBuilder.NotNullAndAlso(property, expression); } return(expression); } throw new InvalidOperationException(); }
protected override Expression HandleListOperation( QueryableFilterContext context, IFilterField field, ObjectFieldNode node, Type closureType, LambdaExpression lambda) => FilterExpressionBuilder.Not( FilterExpressionBuilder.Any(closureType, context.GetInstance(), lambda));
public override Expression HandleOperation( QueryableFilterContext context, IFilterOperationField field, IValueNode value, object parsedValue) { Expression property = context.GetInstance(); return FilterExpressionBuilder.Not( FilterExpressionBuilder.StartsWith(property, parsedValue)); }
public override Expression HandleOperation( QueryableFilterContext context, IFilterOperationField field, IValueNode value, object parsedValue) { Expression property = context.GetInstance(); return(FilterExpressionBuilder.Not( FilterExpressionBuilder.In( property, context.RuntimeTypes.Peek().Source, parsedValue))); }
public override Expression HandleOperation( QueryableFilterContext context, IFilterOperationField field, IValueNode value, object?parsedValue) { Expression property = context.GetInstance(); parsedValue = ParseValue(value, parsedValue, field.Type, context); if (parsedValue is null) { throw new InvalidOperationException(); } return(FilterExpressionBuilder.Not( FilterExpressionBuilder.LowerThanOrEqual(property, parsedValue))); }