Beispiel #1
0
        /// <summary>
        /// Replaces the given expression.
        /// </summary>
        /// <param name="expression">The root node of the expression tree being visited.</param>
        /// <returns>Replaced expression.</returns>
        public virtual QueryExpression Visit(LinqAsEnumerableExpression expression)
        {
            var source = this.ReplaceExpression(expression.Source);

            if (this.HasChanged(expression.Source, source))
            {
                return(new LinqAsEnumerableExpression(source, expression.ExpressionType));
            }
            else
            {
                return(expression);
            }
        }
Beispiel #2
0
 /// <summary>
 /// Visits a QueryExpression tree whose root node is the LinqAsEnumerableExpression.
 /// </summary>
 /// <param name="expression">The root node of the expression tree being visited.</param>
 /// <returns>Uri query string representing the expression.</returns>
 public virtual string Visit(LinqAsEnumerableExpression expression)
 {
     throw new TaupoNotSupportedException("Not supported");
 }
Beispiel #3
0
        /// <summary>
        /// Generates System.CodeDom.CodeExpression from the given expression.
        /// </summary>
        /// <param name="expression">Expression from which System.CodeDom.CodeExpression is generated.</param>
        /// <returns>Generated System.CodeDom.CodeExpression.</returns>
        public virtual CodeExpression Visit(LinqAsEnumerableExpression expression)
        {
            CodeExpression source = this.GenerateCode(expression.Source);

            return(source.Call("AsEnumerable"));
        }
        /// <summary>
        /// Evaluates the specified expression.
        /// </summary>
        /// <param name="expression">The expression to evaluate.</param>
        /// <returns>Value of the expression.</returns>
        public virtual QueryValue Visit(LinqAsEnumerableExpression expression)
        {
            var result = this.Evaluate(expression.Source);

            return(result);
        }
        /// <summary>
        /// Resolves types for the specified expression.
        /// </summary>
        /// <param name="expression">The expression to resolve types for.</param>
        /// <returns>Expression with resolved types.</returns>
        public QueryExpression Visit(LinqAsEnumerableExpression expression)
        {
            var source = this.ResolveTypes(expression.Source);

            return(new LinqAsEnumerableExpression(source, source.ExpressionType));
        }