Example #1
0
        public override void Visit(WhereClause node)
        {
            var childBinaryExpressionVisitor = new ChildPredicateExpressionVisitor();

            node.Accept(childBinaryExpressionVisitor);
            multiClauseQuery = childBinaryExpressionVisitor.PredicatesFound;

            var childVisitor = new ChildFunctionCallVisitor(ChildCallback, multiClauseQuery);

            node.Accept(childVisitor);
        }
Example #2
0
        public override void Visit(WhereClause node)
        {
            var predicateExpressionVisitor = new PredicateVisitor();

            node.Accept(predicateExpressionVisitor);
            multiClauseQuery = predicateExpressionVisitor.PredicatesFound;

            var childVisitor = new FunctionVisitor(VisitorCallback, multiClauseQuery);

            node.Accept(childVisitor);
        }
Example #3
0
        public override void AcceptChildren(WSqlFragmentVisitor visitor)
        {
            if (FromClause != null)
            {
                FromClause.Accept(visitor);
            }
            if (WhereClause != null)
            {
                WhereClause.Accept(visitor);
            }
            if (TopRowFilter != null)
            {
                TopRowFilter.Accept(visitor);
            }
            if (GroupByClause != null)
            {
                GroupByClause.Accept(visitor);
            }
            if (HavingClause != null)
            {
                HavingClause.Accept(visitor);
            }

            if (SelectElements != null)
            {
                var index = 0;
                for (var count = SelectElements.Count; index < count; ++index)
                {
                    SelectElements[index].Accept(visitor);
                }
            }

            base.AcceptChildren(visitor);
        }
Example #4
0
        public void TestWhereClauseAccept()
        {
            Mock <KoraliumSqlVisitor> mock = new Mock <KoraliumSqlVisitor>();
            WhereClause whereClause        = new WhereClause();

            whereClause.Accept(mock.Object);
            mock.Verify(x => x.VisitWhereClause(whereClause));
        }
Example #5
0
        public void Accept()
        {
            var queryModel  = ExpressionHelper.CreateQueryModel <Cook> ();
            var repository  = new MockRepository();
            var visitorMock = repository.StrictMock <IQueryModelVisitor> ();

            visitorMock.VisitWhereClause(_whereClause, queryModel, 1);

            repository.ReplayAll();

            _whereClause.Accept(visitorMock, queryModel, 1);

            repository.VerifyAll();
        }
Example #6
0
        public static WhereStage GetWhereStage(
            IQueryStage previousStage,
            WhereClause whereClause,
            VisitorMetadata visitorMetadata,
            HashSet <PropertyInfo> usedProperties)
        {
            WhereVisitor whereVisitor = new WhereVisitor(previousStage, visitorMetadata);

            whereClause.Accept(whereVisitor);

            foreach (var property in whereVisitor.UsedProperties)
            {
                usedProperties.Add(property);
            }

            return(new WhereStage(
                       previousStage.TypeInfo,
                       previousStage.ParameterExpression,
                       whereVisitor.Expression,
                       previousStage.CurrentType,
                       previousStage.FromAliases,
                       whereVisitor.ContainsFullTextSearch
                       ));
        }
Example #7
0
        public override void Visit(WhereClause node)
        {
            var childVisitor = new ChildFunctionCallVisitor(ChildCallback);

            node.Accept(childVisitor);
        }