Remotion.Linq.SqlBackend.SqlGeneration.SqlGeneratingOuterSelectExpressionVisitor.VisitArgumentOfLocalEvaluation C# (CSharp) Метод

VisitArgumentOfLocalEvaluation() приватный Метод

private VisitArgumentOfLocalEvaluation ( Expression argumentExpression ) : Expression
argumentExpression System.Linq.Expressions.Expression
Результат System.Linq.Expressions.Expression
    private Expression VisitArgumentOfLocalEvaluation (Expression argumentExpression)
    {
      try
      {
        var namedExpression = argumentExpression as NamedExpression;
        if (namedExpression != null && namedExpression.Expression is ConstantExpression)
        {
          // Do not emit constants within a local evaluation; instead, emit "NULL", and directly use the constant expression as the in-memory projection.
          // This enables us to use complex, local-only constants within a local expression.
          VisitExpression (new NamedExpression (namedExpression.Name, Expression.Constant (null)));
          return namedExpression.Expression;
        }
        else
        {
          VisitExpression (argumentExpression);
          var argumentInMemoryProjectionBody = CommandBuilder.GetInMemoryProjectionBody();
          Assertion.DebugAssert (argumentInMemoryProjectionBody != null);

          return argumentInMemoryProjectionBody;
        }
      }
      finally
      {
        CommandBuilder.SetInMemoryProjectionBody (null);
      }
    }