コード例 #1
0
        /// <summary>
        /// Overrides CreateExpressionConverter to return a converter that uses a binding context based on the compiled query parameters,
        /// rather than a default binding context.
        /// </summary>
        /// <returns>An expression converter appropriate for converting this compiled query state instance</returns>
        protected override ExpressionConverter CreateExpressionConverter()
        {
            LambdaExpression lambda      = (LambdaExpression)base.Expression;
            Funcletizer      funcletizer = Funcletizer.CreateCompiledQueryEvaluationFuncletizer(this.ObjectContext, lambda.Parameters.First(), lambda.Parameters.Skip(1).ToList().AsReadOnly());

            // Return a new expression converter that uses the initialized command tree and binding context.
            return(new ExpressionConverter(funcletizer, lambda.Body));
        }
コード例 #2
0
            internal FuncletizingVisitor(
                Funcletizer funcletizer,
                Func <Expression, bool> isClientConstant,
                Func <Expression, bool> isClientVariable)
            {
                EntityUtil.CheckArgumentNull(funcletizer, "funcletizer");
                EntityUtil.CheckArgumentNull(isClientConstant, "isClientConstant");
                EntityUtil.CheckArgumentNull(isClientVariable, "isClientVariable");

                _funcletizer      = funcletizer;
                _isClientConstant = isClientConstant;
                _isClientVariable = isClientVariable;
            }
コード例 #3
0
ファイル: Funcletizer.cs プロジェクト: uQr/referencesource
 internal FuncletizingVisitor(
     Funcletizer funcletizer,
     Func<Expression, bool> isClientConstant,
     Func<Expression, bool> isClientVariable)
 {
     EntityUtil.CheckArgumentNull(funcletizer, "funcletizer");
     EntityUtil.CheckArgumentNull(isClientConstant, "isClientConstant");
     EntityUtil.CheckArgumentNull(isClientVariable, "isClientVariable");
 
     _funcletizer = funcletizer;
     _isClientConstant = isClientConstant;
     _isClientVariable = isClientVariable;
 }
コード例 #4
0
        protected virtual ExpressionConverter CreateExpressionConverter()
        {
            Funcletizer funcletizer = Funcletizer.CreateQueryFuncletizer(this.ObjectContext);

            return(new ExpressionConverter(funcletizer, _expression));
        }
コード例 #5
0
        internal ExpressionConverter(Funcletizer funcletizer, Expression expression)
        {
            EntityUtil.CheckArgumentNull(funcletizer, "funcletizer");
            EntityUtil.CheckArgumentNull(expression, "expression");

            // Funcletize the expression (identify subexpressions that should be evaluated
            // locally)
            _funcletizer = funcletizer;
            expression = funcletizer.Funcletize(expression, out _recompileRequired);

            // Normalize the expression (replace obfuscated parts of the tree with simpler nodes)
            LinqExpressionNormalizer normalizer = new LinqExpressionNormalizer();
            _expression = normalizer.Visit(expression);

            _perspective = funcletizer.RootContext.Perspective;
            _bindingContext = new BindingContext();
            _ignoreInclude = 0;
            _orderByLifter = new OrderByLifter(_aliasGenerator);
        }
コード例 #6
0
            internal FuncletizingVisitor(
                Funcletizer funcletizer,
                Func<Expression, bool> isClientConstant,
                Func<Expression, bool> isClientVariable)
            {
                //Contract.Requires(funcletizer != null);
                //Contract.Requires(isClientConstant != null);
                //Contract.Requires(isClientVariable != null);

                _funcletizer = funcletizer;
                _isClientConstant = isClientConstant;
                _isClientVariable = isClientVariable;
            }