public ShapedQueryFindingExpressionVisitor( [NotNull] RelationalQueryCompilationContext relationalQueryCompilationContext) { Check.NotNull(relationalQueryCompilationContext, nameof(relationalQueryCompilationContext)); _relationalQueryCompilationContext = relationalQueryCompilationContext; }
public ReplaceSqlServerQueryModelVisitor(IQueryOptimizer queryOptimizer , INavigationRewritingExpressionVisitorFactory navigationRewritingExpressionVisitorFactory , ISubQueryMemberPushDownExpressionVisitor subQueryMemberPushDownExpressionVisitor , IQuerySourceTracingExpressionVisitorFactory querySourceTracingExpressionVisitorFactory , IEntityResultFindingExpressionVisitorFactory entityResultFindingExpressionVisitorFactory , ITaskBlockingExpressionVisitor taskBlockingExpressionVisitor , IMemberAccessBindingExpressionVisitorFactory memberAccessBindingExpressionVisitorFactory , IOrderingExpressionVisitorFactory orderingExpressionVisitorFactory , IProjectionExpressionVisitorFactory projectionExpressionVisitorFactory , IEntityQueryableExpressionVisitorFactory entityQueryableExpressionVisitorFactory , IQueryAnnotationExtractor queryAnnotationExtractor , IResultOperatorHandler resultOperatorHandler , IEntityMaterializerSource entityMaterializerSource , IExpressionPrinter expressionPrinter , IRelationalAnnotationProvider relationalAnnotationProvider , IIncludeExpressionVisitorFactory includeExpressionVisitorFactory , ISqlTranslatingExpressionVisitorFactory sqlTranslatingExpressionVisitorFactory , ICompositePredicateExpressionVisitorFactory compositePredicateExpressionVisitorFactory , IConditionalRemovingExpressionVisitorFactory conditionalRemovingExpressionVisitorFactory , IQueryFlattenerFactory queryFlattenerFactory , IDbContextOptions contextOptions , RelationalQueryCompilationContext queryCompilationContext , SqlServerQueryModelVisitor parentQueryModelVisitor , INavigationExpressionCollection collection) : base(queryOptimizer, navigationRewritingExpressionVisitorFactory, subQueryMemberPushDownExpressionVisitor, querySourceTracingExpressionVisitorFactory, entityResultFindingExpressionVisitorFactory, taskBlockingExpressionVisitor, memberAccessBindingExpressionVisitorFactory, orderingExpressionVisitorFactory, projectionExpressionVisitorFactory, entityQueryableExpressionVisitorFactory, queryAnnotationExtractor, resultOperatorHandler, entityMaterializerSource, expressionPrinter, relationalAnnotationProvider, includeExpressionVisitorFactory, sqlTranslatingExpressionVisitorFactory, compositePredicateExpressionVisitorFactory, conditionalRemovingExpressionVisitorFactory, queryFlattenerFactory, contextOptions, queryCompilationContext, parentQueryModelVisitor) { ExpressionCollection = collection; }
public RelationalQueryModelVisitorEx(EntityQueryModelVisitorDependencies dependencies , RelationalQueryModelVisitorDependencies relationalDependencies , RelationalQueryCompilationContext queryCompilationContext , RelationalQueryModelVisitor parentQueryModelVisitor) : base(dependencies, relationalDependencies, queryCompilationContext, parentQueryModelVisitor) { }
/// <summary> /// From IncludeExpressionVisitor in EF core /// </summary> public ReplaceIncludeExpressionVisitor( ISelectExpressionFactory selectExpressionFactory, ICompositePredicateExpressionVisitorFactory compositePredicateExpressionVisitorFactory, IMaterializerFactory materializerFactory, IShaperCommandContextFactory shaperCommandContextFactory, IRelationalAnnotationProvider relationalAnnotationProvider, IQuerySqlGeneratorFactory querySqlGeneratorFactory, IQuerySource querySource, IReadOnlyList <INavigation> navigationPath, RelationalQueryCompilationContext queryCompilationContext, IReadOnlyList <int> queryIndexes, bool querySourceRequiresTracking, INavigationExpressionCollection collection) { _selectExpressionFactory = selectExpressionFactory; _compositePredicateExpressionVisitorFactory = compositePredicateExpressionVisitorFactory; _materializerFactory = materializerFactory; _shaperCommandContextFactory = shaperCommandContextFactory; _relationalAnnotationProvider = relationalAnnotationProvider; _querySqlGeneratorFactory = querySqlGeneratorFactory; _querySource = querySource; _navigationPath = navigationPath; _queryCompilationContext = queryCompilationContext; _queryIndexes = queryIndexes; _querySourceRequiresTracking = querySourceRequiresTracking; _collection = collection; }
/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> public RelationalQueryMetadataExtractingExpressionVisitor( RelationalQueryCompilationContext relationalQueryCompilationContext) { Check.NotNull(relationalQueryCompilationContext, nameof(relationalQueryCompilationContext)); _relationalQueryCompilationContext = relationalQueryCompilationContext; }
public ShapedQueryFindingExpressionVisitor( [NotNull] RelationalQueryCompilationContext relationalQueryCompilationContext) { Check.NotNull(relationalQueryCompilationContext, nameof(relationalQueryCompilationContext)); _relationalQueryCompilationContext = relationalQueryCompilationContext; }
private void SetCustomSelectExpressionProperties(RelationalQueryCompilationContext queryCompilationContext) { if (queryCompilationContext.QueryAnnotations.Any(a => a.GetType() == typeof(WithSqlTweaksResultOperator))) { UseSqlTweaks = true; } }
public IncludeExpressionVisitor( [NotNull] ISelectExpressionFactory selectExpressionFactory, [NotNull] IMaterializerFactory materializerFactory, [NotNull] ICommandBuilderFactory commandBuilderFactory, [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider, [NotNull] ISqlQueryGeneratorFactory sqlQueryGeneratorFactory, [NotNull] IQuerySource querySource, [NotNull] IReadOnlyList<INavigation> navigationPath, [NotNull] RelationalQueryCompilationContext queryCompilationContext, [NotNull] IReadOnlyList<int> queryIndexes, bool querySourceRequiresTracking) { Check.NotNull(selectExpressionFactory, nameof(selectExpressionFactory)); Check.NotNull(materializerFactory, nameof(materializerFactory)); Check.NotNull(commandBuilderFactory, nameof(commandBuilderFactory)); Check.NotNull(relationalAnnotationProvider, nameof(relationalAnnotationProvider)); Check.NotNull(sqlQueryGeneratorFactory, nameof(sqlQueryGeneratorFactory)); Check.NotNull(querySource, nameof(querySource)); Check.NotNull(navigationPath, nameof(navigationPath)); Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); Check.NotNull(queryIndexes, nameof(queryIndexes)); _selectExpressionFactory = selectExpressionFactory; _materializerFactory = materializerFactory; _commandBuilderFactory = commandBuilderFactory; _relationalAnnotationProvider = relationalAnnotationProvider; _sqlQueryGeneratorFactory = sqlQueryGeneratorFactory; _querySource = querySource; _navigationPath = navigationPath; _queryCompilationContext = queryCompilationContext; _queryIndexes = queryIndexes; _querySourceRequiresTracking = querySourceRequiresTracking; }
public CustomSelectExpression( SelectExpressionDependencies dependencies, RelationalQueryCompilationContext queryCompilationContext, string alias) : base(dependencies, queryCompilationContext, alias) { SetCustomSelectExpressionProperties(queryCompilationContext); }
public override LambdaExpression CreateMaterializer(IEntityType entityType, SelectExpression selectExpression, Func <IProperty, SelectExpression, int> projectionAdder, out Dictionary <Type, int[]> typeIndexMap) { if (selectExpression == null) { throw new ArgumentNullException(nameof(selectExpression)); } RelationalQueryCompilationContext queryCompilationContext = _getQueryCompilationContext(selectExpression); var isWithNoLock = queryCompilationContext.QueryAnnotations.OfType <WithNoLockResultOperator>().Any(); if (isWithNoLock) { IEnumerable <TableExpression> tableExpressions = selectExpression.Tables.OfType <TableExpression>().ToArray(); foreach (TableExpression tableExpression in tableExpressions) { WithNoLockTableExpression withNoLockTableExpression = new WithNoLockTableExpression(tableExpression.Table, tableExpression.Schema, tableExpression.Alias, tableExpression.QuerySource); selectExpression.RemoveTable(tableExpression); selectExpression.AddTable(withNoLockTableExpression); } } return(base.CreateMaterializer(entityType, selectExpression, projectionAdder, out typeIndexMap)); }
public SqlServerSystemVersioningSelectExpression( SelectExpressionDependencies dependencies, RelationalQueryCompilationContext queryCompilationContext) : base(dependencies, queryCompilationContext) { SetCustomSelectExpressionProperties(queryCompilationContext); }
public IncludeExpressionVisitor( [NotNull] ISelectExpressionFactory selectExpressionFactory, [NotNull] IMaterializerFactory materializerFactory, [NotNull] IShaperCommandContextFactory shaperCommandContextFactory, [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider, [NotNull] IQuerySqlGeneratorFactory querySqlGeneratorFactory, [NotNull] IQuerySource querySource, [NotNull] IReadOnlyList <INavigation> navigationPath, [NotNull] RelationalQueryCompilationContext queryCompilationContext, [NotNull] IReadOnlyList <int> queryIndexes, bool querySourceRequiresTracking) { Check.NotNull(selectExpressionFactory, nameof(selectExpressionFactory)); Check.NotNull(materializerFactory, nameof(materializerFactory)); Check.NotNull(shaperCommandContextFactory, nameof(shaperCommandContextFactory)); Check.NotNull(relationalAnnotationProvider, nameof(relationalAnnotationProvider)); Check.NotNull(querySqlGeneratorFactory, nameof(querySqlGeneratorFactory)); Check.NotNull(querySource, nameof(querySource)); Check.NotNull(navigationPath, nameof(navigationPath)); Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); Check.NotNull(queryIndexes, nameof(queryIndexes)); _selectExpressionFactory = selectExpressionFactory; _materializerFactory = materializerFactory; _shaperCommandContextFactory = shaperCommandContextFactory; _relationalAnnotationProvider = relationalAnnotationProvider; _querySqlGeneratorFactory = querySqlGeneratorFactory; _querySource = querySource; _navigationPath = navigationPath; _queryCompilationContext = queryCompilationContext; _queryIndexes = queryIndexes; _querySourceRequiresTracking = querySourceRequiresTracking; }
public CustomQueryTranslationPreprocessor( [NotNull] QueryTranslationPreprocessorDependencies dependencies, [NotNull] RelationalQueryTranslationPreprocessorDependencies relationalDependencies, [NotNull] QueryCompilationContext queryCompilationContext) : base(dependencies, relationalDependencies, queryCompilationContext) { _relationalQueryCompilationContext = (RelationalQueryCompilationContext)queryCompilationContext; }
/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> public CollectionJoinApplyingExpressionVisitor([NotNull] RelationalQueryCompilationContext queryCompilationContext) { Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); _splitQuery = queryCompilationContext.QuerySplittingBehavior == QuerySplittingBehavior.SplitQuery; _noConfiguredBehavior = queryCompilationContext.QuerySplittingBehavior == null; _logger = queryCompilationContext.Logger; }
public virtual QueryFlattener Create( RelationalQueryCompilationContext relationalQueryCompilationContext, MethodInfo operatorToFlatten, int readerOffset) => new QueryFlattener( relationalQueryCompilationContext, operatorToFlatten, readerOffset);
public virtual QueryFlattener Create( RelationalQueryCompilationContext relationalQueryCompilationContext, MethodInfo operatorToFlatten, int readerOffset) => new QueryFlattener( relationalQueryCompilationContext, operatorToFlatten, readerOffset);
/// <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 SqlServerQueryModelVisitor( [NotNull] EntityQueryModelVisitorDependencies dependencies, [NotNull] RelationalQueryModelVisitorDependencies relationalDependencies, [NotNull] RelationalQueryCompilationContext queryCompilationContext, // ReSharper disable once SuggestBaseTypeForParameter [CanBeNull] SqlServerQueryModelVisitor parentQueryModelVisitor) : base(dependencies, relationalDependencies, queryCompilationContext, parentQueryModelVisitor) { }
/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> public ResultTransformingExpressionVisitor( [NotNull] RelationalQueryCompilationContext relationalQueryCompilationContext, bool throwOnNullResult) { Check.NotNull(relationalQueryCompilationContext, nameof(relationalQueryCompilationContext)); _relationalQueryCompilationContext = relationalQueryCompilationContext; _throwOnNullResult = throwOnNullResult; }
/// <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 ResultTransformingExpressionVisitor( [NotNull] IQuerySource outerQuerySource, [NotNull] RelationalQueryCompilationContext relationalQueryCompilationContext) { Check.NotNull(outerQuerySource, nameof(outerQuerySource)); Check.NotNull(relationalQueryCompilationContext, nameof(relationalQueryCompilationContext)); _relationalQueryCompilationContext = relationalQueryCompilationContext; }
/// <summary> /// Creates a new instance of the <see cref="QueryTranslationPreprocessor" /> class. /// </summary> /// <param name="dependencies">Parameter object containing dependencies for this class.</param> /// <param name="relationalDependencies">Parameter object containing relational dependencies for this class.</param> /// <param name="queryCompilationContext">The query compilation context object to use.</param> public RelationalQueryTranslationPreprocessor( QueryTranslationPreprocessorDependencies dependencies, RelationalQueryTranslationPreprocessorDependencies relationalDependencies, QueryCompilationContext queryCompilationContext) : base(dependencies, queryCompilationContext) { RelationalDependencies = relationalDependencies; _relationalQueryCompilationContext = (RelationalQueryCompilationContext)queryCompilationContext; }
public RelationalQueryModelVisitor(EntityQueryModelVisitorDependencies dependencies, RelationalQueryModelVisitorDependencies relationalDependencies, RelationalQueryCompilationContext queryCompilationContext, Microsoft.EntityFrameworkCore.Query.RelationalQueryModelVisitor parentQueryModelVisitor) : base(dependencies, relationalDependencies, queryCompilationContext, parentQueryModelVisitor) { _compositePredicateExpressionVisitorFactory = relationalDependencies.CompositePredicateExpressionVisitorFactory; _dependencies = dependencies; _queryCompilationContext = queryCompilationContext; }
/// <summary> /// Creates a new instance of SelectExpression. /// </summary> /// <param name="querySqlGeneratorFactory"> The query SQL generator factory. </param> /// <param name="queryCompilationContext"> Context for the query compilation. </param> public SelectExpression([NotNull] IQuerySqlGeneratorFactory querySqlGeneratorFactory, [NotNull] RelationalQueryCompilationContext queryCompilationContext) : base(null, null) { Check.NotNull(querySqlGeneratorFactory, nameof(querySqlGeneratorFactory)); Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); _querySqlGeneratorFactory = querySqlGeneratorFactory; _queryCompilationContext = queryCompilationContext; }
public SelectExpression([NotNull] IQuerySqlGeneratorFactory querySqlGeneratorFactory, [NotNull] RelationalQueryCompilationContext queryCompilationContext) : base(null, null) { Check.NotNull(querySqlGeneratorFactory, nameof(querySqlGeneratorFactory)); Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); _querySqlGeneratorFactory = querySqlGeneratorFactory; _queryCompilationContext = queryCompilationContext; }
public ResultTransformingExpressionTreeVisitor( [NotNull] IQuerySource outerQuerySource, [NotNull] RelationalQueryCompilationContext relationalQueryCompilationContext) { Check.NotNull(outerQuerySource, "outerQuerySource"); Check.NotNull(relationalQueryCompilationContext, "relationalQueryCompilationContext"); _outerQuerySource = outerQuerySource; _relationalQueryCompilationContext = relationalQueryCompilationContext; }
/// <summary> /// Creates a new instance of SelectExpression. /// </summary> /// <param name="dependencies"> Parameter object containing dependencies for this service. </param> /// <param name="queryCompilationContext"> Context for the query compilation. </param> public SelectExpression( [NotNull] SelectExpressionDependencies dependencies, [NotNull] RelationalQueryCompilationContext queryCompilationContext) : base(null, null) { Check.NotNull(dependencies, nameof(dependencies)); Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); Dependencies = dependencies; _queryCompilationContext = queryCompilationContext; }
/// <summary> /// Creates a new instance of SelectExpression. /// </summary> /// <param name="dependencies"> Parameter object containing dependencies for this service. </param> /// <param name="queryCompilationContext"> Context for the query compilation. </param> /// <param name="alias"> The alias. </param> public SelectExpression( [NotNull] SelectExpressionDependencies dependencies, [NotNull] RelationalQueryCompilationContext queryCompilationContext, [NotNull] string alias) : this(dependencies, queryCompilationContext) { Check.NotNull(alias, nameof(alias)); // When assigning alias to select expression make it unique Alias = queryCompilationContext.CreateUniqueTableAlias(alias); }
/// <summary> /// Creates a new instance of SelectExpression. /// </summary> /// <param name="querySqlGeneratorFactory"> The query SQL generator factory. </param> /// <param name="queryCompilationContext"> Context for the query compilation. </param> /// <param name="alias"> The alias. </param> public SelectExpression( [NotNull] IQuerySqlGeneratorFactory querySqlGeneratorFactory, [NotNull] RelationalQueryCompilationContext queryCompilationContext, [NotNull] string alias) : this(querySqlGeneratorFactory, queryCompilationContext) { Check.NotNull(alias, nameof(alias)); // When assigning alias to select expression make it unique Alias = queryCompilationContext.CreateUniqueTableAlias(alias); }
public override IEnumerable <TResult> Query <TResult>(QueryModel queryModel, StateManager stateManager) { Check.NotNull(queryModel, "queryModel"); Check.NotNull(stateManager, "stateManager"); var queryCompilationContext = new RelationalQueryCompilationContext(Model); var queryExecutor = queryCompilationContext.CreateVisitor().CreateQueryExecutor <TResult>(queryModel); var queryContext = new RelationalQueryContext(Model, Logger, stateManager, _connection, ValueReaderFactory); return(queryExecutor(queryContext, null)); }
public QueryFlattener( [NotNull] RelationalQueryCompilationContext relationalQueryCompilationContext, [NotNull] MethodInfo operatorToFlatten, int readerOffset) { Check.NotNull(relationalQueryCompilationContext, nameof(relationalQueryCompilationContext)); Check.NotNull(operatorToFlatten, nameof(operatorToFlatten)); _relationalQueryCompilationContext = relationalQueryCompilationContext; _readerOffset = readerOffset; _operatorToFlatten = operatorToFlatten; }
public virtual ExpressionVisitor Create( [NotNull] IQuerySource outerQuerySource, [NotNull] IQuerySource innerQuerySource, [NotNull] RelationalQueryCompilationContext relationalQueryCompilationContext, int readerOffset, [NotNull] MethodInfo operatorToFlatten) => new QueryFlatteningExpressionVisitor( outerQuerySource, innerQuerySource, relationalQueryCompilationContext, readerOffset, operatorToFlatten);
public QueryFlattener( [NotNull] RelationalQueryCompilationContext relationalQueryCompilationContext, [NotNull] MethodInfo operatorToFlatten, int readerOffset) { Check.NotNull(relationalQueryCompilationContext, nameof(relationalQueryCompilationContext)); Check.NotNull(operatorToFlatten, nameof(operatorToFlatten)); _relationalQueryCompilationContext = relationalQueryCompilationContext; _readerOffset = readerOffset; _operatorToFlatten = operatorToFlatten; }
public SqlServerQueryModelVisitor( [NotNull] IModel model, [NotNull] IQueryOptimizer queryOptimizer, [NotNull] INavigationRewritingExpressionVisitorFactory navigationRewritingExpressionVisitorFactory, [NotNull] ISubQueryMemberPushDownExpressionVisitor subQueryMemberPushDownExpressionVisitor, [NotNull] IQuerySourceTracingExpressionVisitorFactory querySourceTracingExpressionVisitorFactory, [NotNull] IEntityResultFindingExpressionVisitorFactory entityResultFindingExpressionVisitorFactory, [NotNull] ITaskBlockingExpressionVisitor taskBlockingExpressionVisitor, [NotNull] IMemberAccessBindingExpressionVisitorFactory memberAccessBindingExpressionVisitorFactory, [NotNull] IOrderingExpressionVisitorFactory orderingExpressionVisitorFactory, [NotNull] IProjectionExpressionVisitorFactory projectionExpressionVisitorFactory, [NotNull] IEntityQueryableExpressionVisitorFactory entityQueryableExpressionVisitorFactory, [NotNull] IQueryAnnotationExtractor queryAnnotationExtractor, [NotNull] IResultOperatorHandler resultOperatorHandler, [NotNull] IEntityMaterializerSource entityMaterializerSource, [NotNull] IExpressionPrinter expressionPrinter, [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider, [NotNull] IIncludeExpressionVisitorFactory includeExpressionVisitorFactory, [NotNull] ISqlTranslatingExpressionVisitorFactory sqlTranslatingExpressionVisitorFactory, [NotNull] ICompositePredicateExpressionVisitorFactory compositePredicateExpressionVisitorFactory, [NotNull] IQueryFlatteningExpressionVisitorFactory queryFlatteningExpressionVisitorFactory, [NotNull] IShapedQueryFindingExpressionVisitorFactory shapedQueryFindingExpressionVisitorFactory, [NotNull] IDbContextOptions contextOptions, [NotNull] RelationalQueryCompilationContext queryCompilationContext, // ReSharper disable once SuggestBaseTypeForParameter [CanBeNull] SqlServerQueryModelVisitor parentQueryModelVisitor) : base( Check.NotNull(model, nameof(model)), Check.NotNull(queryOptimizer, nameof(queryOptimizer)), Check.NotNull(navigationRewritingExpressionVisitorFactory, nameof(navigationRewritingExpressionVisitorFactory)), Check.NotNull(subQueryMemberPushDownExpressionVisitor, nameof(subQueryMemberPushDownExpressionVisitor)), Check.NotNull(querySourceTracingExpressionVisitorFactory, nameof(querySourceTracingExpressionVisitorFactory)), Check.NotNull(entityResultFindingExpressionVisitorFactory, nameof(entityResultFindingExpressionVisitorFactory)), Check.NotNull(taskBlockingExpressionVisitor, nameof(taskBlockingExpressionVisitor)), Check.NotNull(memberAccessBindingExpressionVisitorFactory, nameof(memberAccessBindingExpressionVisitorFactory)), Check.NotNull(orderingExpressionVisitorFactory, nameof(orderingExpressionVisitorFactory)), Check.NotNull(projectionExpressionVisitorFactory, nameof(projectionExpressionVisitorFactory)), Check.NotNull(entityQueryableExpressionVisitorFactory, nameof(entityQueryableExpressionVisitorFactory)), Check.NotNull(queryAnnotationExtractor, nameof(queryAnnotationExtractor)), Check.NotNull(resultOperatorHandler, nameof(resultOperatorHandler)), Check.NotNull(entityMaterializerSource, nameof(entityMaterializerSource)), Check.NotNull(expressionPrinter, nameof(expressionPrinter)), Check.NotNull(relationalAnnotationProvider, nameof(relationalAnnotationProvider)), Check.NotNull(includeExpressionVisitorFactory, nameof(includeExpressionVisitorFactory)), Check.NotNull(sqlTranslatingExpressionVisitorFactory, nameof(sqlTranslatingExpressionVisitorFactory)), Check.NotNull(compositePredicateExpressionVisitorFactory, nameof(compositePredicateExpressionVisitorFactory)), Check.NotNull(queryFlatteningExpressionVisitorFactory, nameof(queryFlatteningExpressionVisitorFactory)), Check.NotNull(shapedQueryFindingExpressionVisitorFactory, nameof(queryFlatteningExpressionVisitorFactory)), Check.NotNull(contextOptions, nameof(contextOptions)), Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)), parentQueryModelVisitor) { }
/// <summary> /// Creates a new instance of SelectExpression. /// </summary> /// <param name="dependencies"> Parameter object containing dependencies for this service. </param> /// <param name="queryCompilationContext"> Context for the query compilation. </param> /// <param name="alias"> The alias. </param> public SelectExpression( [NotNull] SelectExpressionDependencies dependencies, [NotNull] RelationalQueryCompilationContext queryCompilationContext, [NotNull] string alias) : this(dependencies, queryCompilationContext) { Check.NotNull(alias, nameof(alias)); // When assigning alias to select expression make it unique // ReSharper disable once VirtualMemberCallInConstructor Alias = queryCompilationContext.CreateUniqueTableAlias(alias); }
public IncludeExpressionTreeVisitor( [NotNull] IQuerySource querySource, [NotNull] IReadOnlyList <INavigation> navigationPath, [NotNull] RelationalQueryCompilationContext queryCompilationContext) { Check.NotNull(querySource, "querySource"); Check.NotNull(navigationPath, "navigationPath"); Check.NotNull(queryCompilationContext, "queryCompilationContext"); _querySource = querySource; _navigationPath = navigationPath; _queryCompilationContext = queryCompilationContext; }
public ModelVisitor( EntityQueryModelVisitorDependencies dependencies, RelationalQueryModelVisitorDependencies relationalDependencies, RelationalQueryCompilationContext context, RelationalQueryModelVisitor visitor) : base(dependencies, relationalDependencies, context, visitor) { var expressionVisitor = new ExpressionVisitor( context, dependencies.QueryModelGenerator, this); field.SetValue(this, expressionVisitor); }
public virtual ExpressionVisitor Create( IQuerySource querySource, IReadOnlyList<INavigation> navigationPath, RelationalQueryCompilationContext relationalQueryCompilationContext, IReadOnlyList<int> queryIndexes, bool querySourceRequiresTracking) => new IncludeExpressionVisitor( _selectExpressionFactory, _materializerFactory, _commandBuilderFactory, _relationalAnnotationProvider, _sqlQueryGeneratorFactory, Check.NotNull(querySource, nameof(querySource)), Check.NotNull(navigationPath, nameof(navigationPath)), Check.NotNull(relationalQueryCompilationContext, nameof(relationalQueryCompilationContext)), Check.NotNull(queryIndexes, nameof(queryIndexes)), querySourceRequiresTracking);
public IncludeExpressionVisitor( [NotNull] IQuerySource querySource, [NotNull] IReadOnlyList<INavigation> navigationPath, [NotNull] RelationalQueryCompilationContext queryCompilationContext, [NotNull] IReadOnlyList<int> readerIndexes, bool querySourceRequiresTracking) { Check.NotNull(querySource, nameof(querySource)); Check.NotNull(navigationPath, nameof(navigationPath)); Check.NotNull(queryCompilationContext, nameof(queryCompilationContext)); _querySource = querySource; _navigationPath = navigationPath; _queryCompilationContext = queryCompilationContext; _readerIndexes = readerIndexes; _querySourceRequiresTracking = querySourceRequiresTracking; }
public QueryFlatteningExpressionVisitor( [NotNull] IQuerySource outerQuerySource, [NotNull] IQuerySource innerQuerySource, [NotNull] RelationalQueryCompilationContext relationalQueryCompilationContext, int readerOffset, [NotNull] MethodInfo operatorToFlatten) { Check.NotNull(outerQuerySource, nameof(outerQuerySource)); Check.NotNull(innerQuerySource, nameof(innerQuerySource)); Check.NotNull(relationalQueryCompilationContext, nameof(relationalQueryCompilationContext)); Check.NotNull(operatorToFlatten, nameof(operatorToFlatten)); _outerQuerySource = outerQuerySource; _innerQuerySource = innerQuerySource; _relationalQueryCompilationContext = relationalQueryCompilationContext; _readerOffset = readerOffset; _operatorToFlatten = operatorToFlatten; }
/// <summary> /// Creates a new SelectExpression. /// </summary> /// <param name="queryCompilationContext"> Context for the query compilation. </param> /// <param name="alias"> The alias of this SelectExpression. </param> /// <returns> /// A SelectExpression. /// </returns> public virtual SelectExpression Create(RelationalQueryCompilationContext queryCompilationContext, string alias) => new SelectExpression( _querySqlGeneratorFactory, queryCompilationContext, Check.NotEmpty(alias, nameof(alias)));
/// <summary> /// Creates a new SelectExpression. /// </summary> /// <param name="queryCompilationContext"> Context for the query compilation. </param> /// <returns> /// A SelectExpression. /// </returns> public virtual SelectExpression Create(RelationalQueryCompilationContext queryCompilationContext) => new SelectExpression(_querySqlGeneratorFactory, queryCompilationContext);
private CommandBuilder setupCommandBuilder(DbContext context) { var source = new EntityMaterializerSource(new MemberMapper(new FieldMatcher())); var loggerFactory = new LoggerFactory(); var selectExpression = new SelectExpression(); var queryCompilationContext = new RelationalQueryCompilationContext( context.Model, loggerFactory.CreateLogger("new"), new LinqOperatorProvider(), new RelationalResultOperatorHandler(), source, new EntityKeyFactorySource(new BoxedValueReaderSource()), new AsyncQueryMethodProvider(), new CompositeMethodCallTranslator()); return new CommandBuilder(selectExpression, queryCompilationContext); }