示例#1
0
        public CmsqlExpressionVisitorContext Parse(
            ContentType contentType,
            ICmsqlQueryExpression expression)
        {
            CmsqlExpressionVisitorContext context = new CmsqlExpressionVisitorContext(contentType);

            if (contentType == null)
            {
                return(context);
            }

            if (expression == null)
            {
                context.PushNewPropertyCriteriaCollection();
                return(context);
            }

            CmsqlExpressionVisitor visitor =
                new CmsqlExpressionVisitor(
                    new QueryConditionToPropertyCriteriaMapper(
                        new PropertyDataTypeResolver(contentType)), context);

            expression.Accept(visitor);

            return(context);
        }
        public virtual void VisitQueryExpression(CmsqlQueryBinaryExpression binaryExpression)
        {
            CmsqlExpressionVisitor visitor = binaryExpression.Operator == ConditionalOperator.Or
                ? new CmsqlBinaryOrExpressionVisitor(_conditionToCriteriaMapper, Context)
                : new CmsqlExpressionVisitor(_conditionToCriteriaMapper, Context);

            binaryExpression.LeftExpression.Accept(visitor);
            binaryExpression.RightExpression.Accept(visitor);
        }