Exemple #1
0
        public static Expression ExtractParameters(
            [NotNull] Expression expression,
            [NotNull] QueryContext queryContext,
            [NotNull] IEvaluatableExpressionFilter evaluatableExpressionFilter,
            [NotNull] ISensitiveDataLogger logger)
        {
            var visitor = new ParameterExtractingExpressionVisitor(evaluatableExpressionFilter, queryContext, logger);

            return(visitor.ExtractParameters(expression));
        }
Exemple #2
0
        /// <summary>
        ///     This API supports the Entity Framework Core infrastructure and is not intended to be used
        ///     directly from your code. This API may change or be removed in future releases.
        /// </summary>
        public static Expression ExtractParameters(
            [NotNull] Expression expression,
            [NotNull] QueryContext queryContext,
            [NotNull] IEvaluatableExpressionFilter evaluatableExpressionFilter,
            [NotNull] IInterceptingLogger <LoggerCategory.Query> logger,
            bool parameterize)
        {
            var visitor
                = new ParameterExtractingExpressionVisitor(
                      evaluatableExpressionFilter,
                      queryContext,
                      logger,
                      parameterize);

            return(visitor.ExtractParameters(expression));
        }
Exemple #3
0
        /// <summary>
        ///     This API supports the Entity Framework Core infrastructure and is not intended to be used
        ///     directly from your code. This API may change or be removed in future releases.
        /// </summary>
        public ModelExpressionApplyingExpressionVisitor(
            [NotNull] QueryCompilationContext queryCompilationContext,
            [NotNull] IQueryModelGenerator queryModelGenerator,
            [NotNull] EntityQueryModelVisitor entityQueryModelVisitor)
        {
            Check.NotNull(queryCompilationContext, nameof(queryCompilationContext));
            Check.NotNull(queryModelGenerator, nameof(queryModelGenerator));
            Check.NotNull(entityQueryModelVisitor, nameof(entityQueryModelVisitor));

            _queryCompilationContext = queryCompilationContext;
            _queryModelGenerator     = queryModelGenerator;
            _entityQueryModelVisitor = entityQueryModelVisitor;

            _parameterExtractingExpressionVisitor = new ParameterExtractingExpressionVisitor(
                ((QueryModelGenerator)queryModelGenerator).EvaluatableExpressionFilter,
                _parameters,
                _queryCompilationContext.ContextType,
                _queryCompilationContext.Logger,
                parameterize: false,
                generateContextAccessors: true);
        }