private static Expression LteInvocation(ExpressionFilterQuerySyntaxVisitor visitor, InvocationQuerySyntaxNode node)
        {
            // lte(property, value) --> i.property <= value
            var property = visitor.Visit(node.Arguments[0]);
            var value    = visitor.Visit(node.Arguments[1]);

            return(QuerySyntaxHelper.Compare(property, value, Expression.LessThanOrEqual));
        }
        private static Expression GtInvocation(ExpressionFilterQuerySyntaxVisitor visitor, InvocationQuerySyntaxNode node)
        {
            // gt(property, value) --> i.property > value
            var property = visitor.Visit(node.Arguments[0]);
            var value    = visitor.Visit(node.Arguments[1]);

            return(QuerySyntaxHelper.Compare(property, value, Expression.GreaterThan));
        }
        private static Expression CreateSizeFilterForArrayProperty(ExpressionFilterQuerySyntaxVisitor visitor, InvocationQuerySyntaxNode node, Func <Expression, Expression, Expression> filter)
        {
            // filter(arrayProperty, value) --> filter(Enumerable.Count(i.arrayProperty), value)
            var arrayProperty = visitor.Visit(node.Arguments[0]);
            var value         = visitor.Visit(node.Arguments[1]);
            var itemType      = QuerySyntaxHelper.GetCollectionItemType(arrayProperty.Type);

            return(QuerySyntaxHelper.Compare(QuerySyntaxHelper.InvokeCount(itemType, arrayProperty), value, filter));
        }
        private static Expression CreateAnyFilterForArrayProperty(ExpressionFilterQuerySyntaxVisitor visitor, InvocationQuerySyntaxNode node, Func <Expression, Expression, Expression> filter)
        {
            // filter(arrayProperty, item) --> Enumerable.Any(i.arrayProperty, ii => filter(ii, item))
            var arrayProperty = visitor.Visit(node.Arguments[0]);
            var item          = visitor.Visit(node.Arguments[1]);
            var itemType      = QuerySyntaxHelper.GetCollectionItemType(arrayProperty.Type);
            var itemParameter = Expression.Parameter(itemType);

            return(QuerySyntaxHelper.InvokeAny(itemType, arrayProperty, Expression.Lambda(QuerySyntaxHelper.Compare(itemParameter, item, filter), itemParameter)));
        }