private static BinaryExpression GetANDExpression(ParameterExpression param, PartialExp filter1, PartialExp filter2)
        {
            Expression bin1 = GetExpression(param, filter1);
            Expression bin2 = GetExpression(param, filter2);

            return(Expression.AndAlso(bin1, bin2));
        }
        private static Expression GetExpression(ParameterExpression param, PartialExp filter)
        {
            MemberExpression   member   = Expression.Property(param, filter.PropertyName);
            ConstantExpression constant = Expression.Constant(filter.Value);

            switch (filter.Operation)
            {
            case Op.Equals:
                return(Expression.Equal(member, constant));

            case Op.GreaterThan:
                return(Expression.GreaterThan(member, constant));

            case Op.GreaterThanOrEqual:
                return(Expression.GreaterThanOrEqual(member, constant));

            case Op.LessThan:
                return(Expression.LessThan(member, constant));

            case Op.LessThanOrEqual:
                return(Expression.LessThanOrEqual(member, constant));

            case Op.Contains:
                return(Expression.Call(member, containsMethod, constant));

            case Op.StartsWith:
                return(Expression.Call(member, startsWithMethod, constant));

            case Op.EndsWith:
                return(Expression.Call(member, endsWithMethod, constant));
            }

            return(null);
        }