Example #1
0
        protected override Expression VisitSubQuery(SubQueryExpression expression)
        {
            if (!HandleJoin && !HandleLet)
            {
                ModelVisitor.QueryText.Append(" ( ");
            }

            var visitor = new ArangoModelVisitor(ModelVisitor.Db);

            if (HandleLet)
            {
                visitor.DefaultAssociatedIdentifier = QueryModel.MainFromClause.ItemName;
            }

            visitor.QueryText          = ModelVisitor.QueryText;
            visitor.ParnetModelVisitor = ModelVisitor;
            visitor.IgnoreFromClause   = HandleLet;

            visitor.VisitQueryModel(expression.QueryModel);

            if (!HandleJoin && !HandleLet)
            {
                ModelVisitor.QueryText.Append(" ) ");
            }

            return(expression);
        }
        ICursor <T> GetCursor <T>(QueryModel queryModel)
        {
            var visitor = new ArangoModelVisitor(db);

            visitor.VisitQueryModel(queryModel);

            visitor.QueryData.Query = visitor.QueryText.ToString();

            return(db.CreateStatement <T>(visitor.QueryData.Query,
                                          bindVars: visitor.QueryData.BindVars));
        }
        public QueryData GetQueryData(Expression expression)
        {
            LinqUtility.CheckNotNull("expression", expression);

            var queryModel = GenerateQueryModel(expression);

            var visitor = new ArangoModelVisitor(db);

            visitor.VisitQueryModel(queryModel);

            visitor.QueryData.Query = visitor.QueryText.ToString();

            return(visitor.QueryData);
        }