public static NamedExpression CreateFromMemberName(string memberName, Expression innerExpression)
        {
            LinqUtility.CheckNotNull("memberName", memberName);
            LinqUtility.CheckNotNull("innerExpression", innerExpression);

            return(new NamedExpression(memberName, innerExpression));
        }
        public NamedExpression(string name, Expression expression)
        {
            LinqUtility.CheckNotNull("expression", expression);

            Name       = name;
            Expression = expression;
        }
示例#3
0
        /// <summary>
        ///     Initializes a new instance of <see cref="ArangoQueryProvider" /> using a custom <see cref="IQueryParser" />.
        /// </summary>
        public ArangoQueryProvider(Type queryableType, IQueryParser queryParser, IQueryExecutor executor,
                                   IArangoLinq db)
            : base(LinqUtility.CheckNotNull("queryParser", queryParser), LinqUtility.CheckNotNull("executor", executor))
        {
            LinqUtility.CheckNotNull("queryableType", queryableType);
            CheckQueryableType(queryableType);

            QueryableType = queryableType;
            this.db       = db;
        }
        protected override Expression Accept(ExpressionVisitor visitor)
        {
            LinqUtility.CheckNotNull("visitor", visitor);

            var specificVisitor = visitor as INamedExpressionVisitor;

            if (specificVisitor != null)
            {
                return(specificVisitor.VisitNamed(this));
            }
            return(base.Accept(visitor));
        }
        protected override Expression VisitChildren(ExpressionVisitor visitor)
        {
            LinqUtility.CheckNotNull("visitor", visitor);

            var newExpression = visitor.Visit(Expression);

            if (newExpression != Expression)
            {
                return(new NamedExpression(Name, newExpression));
            }
            return(this);
        }
示例#6
0
        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);
        }
        public static Expression CreateNewExpressionWithNamedArguments(IArangoLinq db, NewExpression expression)
        {
            LinqUtility.CheckNotNull("expression", expression);

            return(CreateNewExpressionWithNamedArguments(db, expression, expression.Arguments));
        }