Exemplo n.º 1
0
        private Expression CreateFilterExpression()
        {
            Expression right = Second?.Apply(Column.Expression.Body);
            Expression left  = First?.Apply(Column.Expression.Body);

            if (left != null && right != null)
            {
                switch (Operator)
                {
                case "And":
                    return(Expression.AndAlso(left, right));

                case "Or":
                    return(Expression.OrElse(left, right));
                }
            }

            return(left ?? right);
        }
Exemplo n.º 2
0
        private Expression CreateFilterExpression()
        {
            Expression left  = First?.Apply(Column.Expression.Body);
            Expression right = Second?.Apply(Column.Expression.Body);

            if (IsMulti == true && left != null && right != null)
            {
                if ("and".Equals(Operator, StringComparison.OrdinalIgnoreCase))
                {
                    return(Expression.AndAlso(left, right));
                }

                if ("or".Equals(Operator, StringComparison.OrdinalIgnoreCase))
                {
                    return(Expression.OrElse(left, right));
                }
            }

            return(left ?? right);
        }
Exemplo n.º 3
0
        private Expression?BuildFilterExpression()
        {
            Expression?left = First?.Apply(Column.Expression.Body);

            if (Type == GridFilterType.Double && left != null)
            {
                Expression?right = Second?.Apply(Column.Expression.Body);

                if (right != null && "and".Equals(Operator, StringComparison.OrdinalIgnoreCase))
                {
                    return(Expression.AndAlso(left, right));
                }

                if (right != null && "or".Equals(Operator, StringComparison.OrdinalIgnoreCase))
                {
                    return(Expression.OrElse(left, right));
                }
            }

            return(left);
        }