Пример #1
0
 /// <summary>
 /// Set up a new binding scope where parameter expressions map to their paired CQT expressions.
 /// </summary>
 /// <param name="binding">DbExpression/LinqExpression binding</param>
 internal void PushBindingScope(Binding binding)
 {
     _scopes.Push(binding);
 }
Пример #2
0
        // Utility translator method for lambda expressions. Given a lambda expression and its translated
        // inputs, translates the lambda expression
        private DbExpression TranslateLambda(LambdaExpression lambda, DbExpression input)
        {
            Binding scopeBinding = new Binding(lambda.Parameters[0], input);

            // push the binding scope
            _bindingContext.PushBindingScope(scopeBinding);

            // translate expression within this binding scope
#if DEBUG
            int preValue = _ignoreInclude;
#endif
            _ignoreInclude++;
            DbExpression result = TranslateExpression(lambda.Body);
            _ignoreInclude--;
#if DEBUG
            Debug.Assert(preValue == _ignoreInclude);
#endif

            // pop binding scope
            _bindingContext.PopBindingScope();

            return result;
        }