public MongoDbEntityQueryableExpressionVisitor(
            [NotNull] EntityQueryModelVisitor entityQueryModelVisitor,
            [NotNull] IModel model,
            [NotNull] IMongoDbAnnotationsProvider annotationsProvider,
            [NotNull] IFindExpressionFactory findExpressionFactory,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] IShaperCommandContextFactory shaperCommandContextFactory,
            [NotNull] IValueBufferFromBsonShaperFactory valueBufferShaperFactory)
            : base(Check.NotNull(entityQueryModelVisitor, nameof(entityQueryModelVisitor)))
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(annotationsProvider, nameof(annotationsProvider));
            Check.NotNull(findExpressionFactory, nameof(findExpressionFactory));
            Check.NotNull(materializerFactory, nameof(materializerFactory));
            Check.NotNull(shaperCommandContextFactory, nameof(shaperCommandContextFactory));
            Check.NotNull(valueBufferShaperFactory, nameof(valueBufferShaperFactory));


            _model = model;
            _annotationsProvider         = annotationsProvider;
            _findExpressionFactory       = findExpressionFactory;
            _materializerFactory         = materializerFactory;
            _shaperCommandContextFactory = shaperCommandContextFactory;
            _valueBufferShaperFactory    = valueBufferShaperFactory;
        }
        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;
        }
Esempio n. 3
0
        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;
        }
 /// <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>
 ///     Clones this dependency parameter object with one service replaced.
 /// </summary>
 /// <param name="materializerFactory"> A replacement for the current dependency of this type. </param>
 /// <returns> A new parameter object with the given service replaced. </returns>
 public RelationalEntityQueryableExpressionVisitorDependencies With([NotNull] IMaterializerFactory materializerFactory)
 => new RelationalEntityQueryableExpressionVisitorDependencies(
     Model,
     SelectExpressionFactory,
     materializerFactory,
     ShaperCommandContextFactory,
     RelationalAnnotationProvider);
Esempio n. 6
0
        public RelationalEntityQueryableExpressionVisitor(
            [NotNull] IModel model,
            [NotNull] IKeyValueFactorySource keyValueFactorySource,
            [NotNull] ISelectExpressionFactory selectExpressionFactory,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] ICommandBuilderFactory commandBuilderFactory,
            [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider,
            [NotNull] RelationalQueryModelVisitor queryModelVisitor,
            [CanBeNull] IQuerySource querySource)
            : base(Check.NotNull(queryModelVisitor, nameof(queryModelVisitor)))
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(keyValueFactorySource, nameof(keyValueFactorySource));
            Check.NotNull(selectExpressionFactory, nameof(selectExpressionFactory));
            Check.NotNull(materializerFactory, nameof(materializerFactory));
            Check.NotNull(commandBuilderFactory, nameof(commandBuilderFactory));
            Check.NotNull(relationalAnnotationProvider, nameof(relationalAnnotationProvider));

            _model = model;
            _keyValueFactorySource        = keyValueFactorySource;
            _selectExpressionFactory      = selectExpressionFactory;
            _materializerFactory          = materializerFactory;
            _commandBuilderFactory        = commandBuilderFactory;
            _relationalAnnotationProvider = relationalAnnotationProvider;
            _querySource = querySource;
        }
Esempio n. 7
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 InMemoryQueryModelVisitorFactory(
            [NotNull] EntityQueryModelVisitorDependencies dependencies,
            [NotNull] IMaterializerFactory materializerFactory)
            : base(dependencies)
        {
            Check.NotNull(materializerFactory, nameof(materializerFactory));

            _materializerFactory = materializerFactory;
        }
 public MaterializingRelationalEntityQueryableExpressionVisitorFactory(IModel model, ISelectExpressionFactory selectExpressionFactory, IMaterializerFactory materializerFactory, 
     IShaperCommandContextFactory shaperCommandContextFactory, IRelationalAnnotationProvider relationalAnnotationProvider) : base(model, selectExpressionFactory, materializerFactory, shaperCommandContextFactory, relationalAnnotationProvider)
 {
     _model = model;
     _selectExpressionFactory = selectExpressionFactory;
     _materializerFactory = materializerFactory;
     _shaperCommandContextFactory = shaperCommandContextFactory;
     _relationalAnnotationProvider = relationalAnnotationProvider;
 }
        /// <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 InMemoryQueryModelVisitor(
            [NotNull] EntityQueryModelVisitorDependencies dependencies,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] QueryCompilationContext queryCompilationContext)
            : base(dependencies, queryCompilationContext)
        {
            Check.NotNull(materializerFactory, nameof(materializerFactory));

            _materializerFactory = materializerFactory;
        }
        public InMemoryEntityQueryableExpressionVisitorFactory(
            [NotNull] IModel model,
            [NotNull] IMaterializerFactory materializerFactory)
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(materializerFactory, nameof(materializerFactory));

            _model = model;
            _materializerFactory = materializerFactory;
        }
Esempio n. 11
0
 public RelationalEntityQueryableExpressionVisitor(RelationalEntityQueryableExpressionVisitorDependencies dependencies
                                                   , RelationalQueryModelVisitor queryModelVisitor, IQuerySource querySource)
     : base(dependencies, queryModelVisitor, querySource)
 {
     _model = dependencies.Model;
     _selectExpressionFactory     = dependencies.SelectExpressionFactory;
     _shaperCommandContextFactory = dependencies.ShaperCommandContextFactory;
     _materializerFactory         = dependencies.MaterializerFactory;
     _querySource = querySource;
 }
        /// <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 InMemoryEntityQueryableExpressionVisitorFactory(
            [NotNull] IModel model,
            [NotNull] IMaterializerFactory materializerFactory)
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(materializerFactory, nameof(materializerFactory));

            _model = model;
            _materializerFactory = materializerFactory;
        }
Esempio n. 13
0
 public SelectorIncludeInjectingExpressionVisitor(
     IncludeSpecification includeSpecification,
     IMaterializerFactory materializerFactory,
     Expression accessorExpression,
     bool querySourceRequiresTracking)
 {
     _includeSpecification        = includeSpecification;
     _materializerFactory         = materializerFactory;
     _accessorExpression          = accessorExpression;
     _querySourceRequiresTracking = querySourceRequiresTracking;
 }
 public SqlServerExtensionsRelationalEntityQueryableExpressionVisitor(RelationalEntityQueryableExpressionVisitorDependencies dependencies
                                                                      , RelationalQueryModelVisitor queryModelVisitor
                                                                      , IQuerySource querySource)
     : base(dependencies, queryModelVisitor, querySource)
 {
     _model = (dependencies ?? throw new ArgumentNullException(nameof(dependencies))).Model;
     _selectExpressionFactory     = dependencies.SelectExpressionFactory;
     _materializerFactory         = dependencies.MaterializerFactory;
     _shaperCommandContextFactory = dependencies.ShaperCommandContextFactory;
     _querySource = querySource;
 }
Esempio n. 15
0
        public InMemoryEntityQueryableExpressionVisitorFactory(
            [NotNull] IModel model,
            [NotNull] IKeyValueFactorySource keyValueFactorySource,
            [NotNull] IMaterializerFactory materializerFactory)
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(keyValueFactorySource, nameof(keyValueFactorySource));
            Check.NotNull(materializerFactory, nameof(materializerFactory));

            _model = model;
            _keyValueFactorySource = keyValueFactorySource;
            _materializerFactory   = materializerFactory;
        }
        public InMemoryEntityQueryableExpressionVisitorFactory(
            [NotNull] IModel model,
            [NotNull] IKeyValueFactorySource keyValueFactorySource,
            [NotNull] IMaterializerFactory materializerFactory)
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(keyValueFactorySource, nameof(keyValueFactorySource));
            Check.NotNull(materializerFactory, nameof(materializerFactory));

            _model = model;
            _keyValueFactorySource = keyValueFactorySource;
            _materializerFactory = materializerFactory;
        }
Esempio n. 17
0
 public SelectorIncludeInjectingExpressionVisitor(
     [NotNull] IncludeSpecification includeSpecification,
     [NotNull] IMaterializerFactory materializerFactory,
     [NotNull] QueryCompilationContext queryCompilationContext,
     [NotNull] Expression accessorExpression,
     bool querySourceRequiresTracking)
 {
     _includeSpecification        = includeSpecification;
     _materializerFactory         = materializerFactory;
     _queryCompilationContext     = queryCompilationContext;
     _accessorExpression          = accessorExpression;
     _querySourceRequiresTracking = querySourceRequiresTracking;
 }
Esempio n. 18
0
 public InMemoryIncludeExpressionVisitor(
     [NotNull] IMaterializerFactory materializerFactory,
     [NotNull] ILinqOperatorProvider linqOperatorProvider,
     [NotNull] IncludeSpecification includeSpecification,
     [NotNull] Expression accessorExpression,
     bool querySourceRequiresTracking)
 {
     _materializerFactory         = materializerFactory;
     _linqOperatorProvider        = linqOperatorProvider;
     _includeSpecification        = includeSpecification;
     _accessorExpression          = accessorExpression;
     _querySourceRequiresTracking = querySourceRequiresTracking;
 }
        /// <summary>
        ///     Creates a new instance of <see cref="RelationalEntityQueryableExpressionVisitor" />.
        /// </summary>
        /// <param name="dependencies"> Parameter object containing dependencies for this service. </param>
        /// <param name="queryModelVisitor"> The query model visitor. </param>
        /// <param name="querySource"> The query source. </param>
        public RelationalEntityQueryableExpressionVisitor(
            [NotNull] RelationalEntityQueryableExpressionVisitorDependencies dependencies,
            [NotNull] RelationalQueryModelVisitor queryModelVisitor,
            [CanBeNull] IQuerySource querySource)
            : base(Check.NotNull(queryModelVisitor, nameof(queryModelVisitor)))
        {
            Check.NotNull(dependencies, nameof(dependencies));

            _model = dependencies.Model;
            _selectExpressionFactory     = dependencies.SelectExpressionFactory;
            _materializerFactory         = dependencies.MaterializerFactory;
            _shaperCommandContextFactory = dependencies.ShaperCommandContextFactory;
            _querySource = querySource;
        }
        public InMemoryEntityQueryableExpressionVisitor(
            [NotNull] IModel model,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] EntityQueryModelVisitor entityQueryModelVisitor,
            [CanBeNull] IQuerySource querySource)
            : base(Check.NotNull(entityQueryModelVisitor, nameof(entityQueryModelVisitor)))
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(materializerFactory, nameof(materializerFactory));

            _model = model;
            _materializerFactory = materializerFactory;
            _querySource = querySource;
        }
Esempio n. 21
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 InMemoryEntityQueryableExpressionVisitor(
            [NotNull] IModel model,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] EntityQueryModelVisitor entityQueryModelVisitor,
            [CanBeNull] IQuerySource querySource)
            : base(Check.NotNull(entityQueryModelVisitor, nameof(entityQueryModelVisitor)))
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(materializerFactory, nameof(materializerFactory));

            _model = model;
            _materializerFactory = materializerFactory;
            _querySource         = querySource;
        }
Esempio n. 22
0
 public ReplaceIncludeExpressionVisitorFactory(ISelectExpressionFactory selectExpressionFactory
                                               , ICompositePredicateExpressionVisitorFactory compositePredicateExpressionVisitorFactory
                                               , IMaterializerFactory materializerFactory
                                               , IShaperCommandContextFactory shaperCommandContextFactory
                                               , IRelationalAnnotationProvider relationalAnnotationProvider
                                               , IQuerySqlGeneratorFactory querySqlGeneratorFactory
                                               , INavigationExpressionCollection collection)
 {
     _selectExpressionFactory = selectExpressionFactory;
     _compositePredicateExpressionVisitorFactory = compositePredicateExpressionVisitorFactory;
     _materializerFactory          = materializerFactory;
     _shaperCommandContextFactory  = shaperCommandContextFactory;
     _relationalAnnotationProvider = relationalAnnotationProvider;
     _querySqlGeneratorFactory     = querySqlGeneratorFactory;
     _collection = collection;
 }
Esempio n. 23
0
 public LiteDBEntityQueryableExpressionVisitorFactory(
     IModel model,
     ILiteDBAnnotationsProvider annotationsProvider,
     IFindExpressionFactory findExpressionFactory,
     IMaterializerFactory materializerFactory,
     IShaperCommandContextFactory shaperCommandContextFactory,
     IValueBufferFromBsonShaperFactory valueBufferShaperFactory
     )
 {
     _model = model;
     _annotationsProvider         = annotationsProvider;
     _findExpressionFactory       = findExpressionFactory;
     _materializerFactory         = materializerFactory;
     _shaperCommandContextFactory = shaperCommandContextFactory;
     _valueBufferShaperFactory    = valueBufferShaperFactory;
 }
        /// <summary>
        ///     <para>
        ///         Creates the service dependencies parameter object for a
        ///         <see cref="RelationalEntityQueryableExpressionVisitorFactory" />.
        ///     </para>
        ///     <para>
        ///         Do not call this constructor directly from either provider or application code as it may change
        ///         as new dependencies are added. Instead, use this type in your constructor so that an instance
        ///         will be created and injected automatically by the dependency injection container. To create
        ///         an instance with some dependent services replaced, first resolve the object from the dependency
        ///         injection container, then replace selected services using the 'With...' methods. Do not call
        ///         the constructor at any point in this process.
        ///     </para>
        /// </summary>
        /// <param name="model"> The model. </param>
        /// <param name="selectExpressionFactory"> The select expression factory. </param>
        /// <param name="materializerFactory"> The materializer factory. </param>
        /// <param name="shaperCommandContextFactory"> The shaper command context factory. </param>
        public RelationalEntityQueryableExpressionVisitorDependencies(
            [NotNull] IModel model,
            [NotNull] ISelectExpressionFactory selectExpressionFactory,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] IShaperCommandContextFactory shaperCommandContextFactory)
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(selectExpressionFactory, nameof(selectExpressionFactory));
            Check.NotNull(materializerFactory, nameof(materializerFactory));
            Check.NotNull(shaperCommandContextFactory, nameof(shaperCommandContextFactory));

            Model = model;
            SelectExpressionFactory     = selectExpressionFactory;
            MaterializerFactory         = materializerFactory;
            ShaperCommandContextFactory = shaperCommandContextFactory;
        }
Esempio n. 25
0
        public IncludeExpressionVisitorFactory(
            [NotNull] ISelectExpressionFactory selectExpressionFactory,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] ICommandBuilderFactory commandBuilderFactory,
            [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider,
            [NotNull] ISqlQueryGeneratorFactory sqlQueryGeneratorFactory)
        {
            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));

            _selectExpressionFactory      = selectExpressionFactory;
            _materializerFactory          = materializerFactory;
            _commandBuilderFactory        = commandBuilderFactory;
            _relationalAnnotationProvider = relationalAnnotationProvider;
            _sqlQueryGeneratorFactory     = sqlQueryGeneratorFactory;
        }
        public RelationalEntityQueryableExpressionVisitorFactory(
            [NotNull] IModel model,
            [NotNull] ISelectExpressionFactory selectExpressionFactory,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] IShaperCommandContextFactory shaperCommandContextFactory,
            [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider)
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(selectExpressionFactory, nameof(selectExpressionFactory));
            Check.NotNull(materializerFactory, nameof(materializerFactory));
            Check.NotNull(shaperCommandContextFactory, nameof(shaperCommandContextFactory));
            Check.NotNull(relationalAnnotationProvider, nameof(relationalAnnotationProvider));

            _model = model;
            _selectExpressionFactory      = selectExpressionFactory;
            _materializerFactory          = materializerFactory;
            _shaperCommandContextFactory  = shaperCommandContextFactory;
            _relationalAnnotationProvider = relationalAnnotationProvider;
        }
Esempio n. 27
0
        public IncludeExpressionVisitorFactory(
            [NotNull] ISelectExpressionFactory selectExpressionFactory,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] IShaperCommandContextFactory shaperCommandContextFactory,
            [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider,
            [NotNull] IQuerySqlGeneratorFactory querySqlGeneratorFactory)
        {
            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));

            _selectExpressionFactory      = selectExpressionFactory;
            _materializerFactory          = materializerFactory;
            _shaperCommandContextFactory  = shaperCommandContextFactory;
            _relationalAnnotationProvider = relationalAnnotationProvider;
            _querySqlGeneratorFactory     = querySqlGeneratorFactory;
        }
        public IncludeExpressionVisitorFactory(
            [NotNull] ISelectExpressionFactory selectExpressionFactory,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] ICommandBuilderFactory commandBuilderFactory,
            [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider,
            [NotNull] ISqlQueryGeneratorFactory sqlQueryGeneratorFactory)
        {
            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));

            _selectExpressionFactory = selectExpressionFactory;
            _materializerFactory = materializerFactory;
            _commandBuilderFactory = commandBuilderFactory;
            _relationalAnnotationProvider = relationalAnnotationProvider;
            _sqlQueryGeneratorFactory = sqlQueryGeneratorFactory;
        }
        /// <summary>
        ///     Creates a new instance of <see cref="RelationalEntityQueryableExpressionVisitorFactory" />.
        /// </summary>
        /// <param name="model"> The model. </param>
        /// <param name="selectExpressionFactory"> The select expression factory. </param>
        /// <param name="materializerFactory"> The materializer factory. </param>
        /// <param name="shaperCommandContextFactory"> The shaper command context factory. </param>
        /// <param name="relationalAnnotationProvider"> The relational annotation provider. </param>
        public RelationalEntityQueryableExpressionVisitorFactory(
            [NotNull] IModel model,
            [NotNull] ISelectExpressionFactory selectExpressionFactory,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] IShaperCommandContextFactory shaperCommandContextFactory,
            [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider)
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(selectExpressionFactory, nameof(selectExpressionFactory));
            Check.NotNull(materializerFactory, nameof(materializerFactory));
            Check.NotNull(shaperCommandContextFactory, nameof(shaperCommandContextFactory));
            Check.NotNull(relationalAnnotationProvider, nameof(relationalAnnotationProvider));

            _model = model;
            _selectExpressionFactory = selectExpressionFactory;
            _materializerFactory = materializerFactory;
            _shaperCommandContextFactory = shaperCommandContextFactory;
            _relationalAnnotationProvider = relationalAnnotationProvider;
        }
Esempio n. 30
0
        public static Func <DbDataReader, TResult> GetMaterializer <TResult>(
            this DbContext dbContext,
            SelectExpression databaseExpression,
            IReadOnlyDictionary <string, object> parameters = null)
        {
            IMaterializerFactory       materializerFactory = dbContext.GetService <IMaterializerFactory>();
            Func <ValueBuffer, object> materializer        = (Func <ValueBuffer, object>)materializerFactory
                                                             .CreateMaterializer(
                entityType: dbContext.Model.FindEntityType(typeof(TResult)),
                selectExpression: databaseExpression,
                projectionAdder: (property, expression) => expression.AddToProjection(
                    property, databaseExpression.QuerySource),
                typeIndexMap: out _)
                                                             .Compile();
            IQuerySqlGeneratorFactory            sqlGeneratorFactory = dbContext.GetService <IQuerySqlGeneratorFactory>();
            IQuerySqlGenerator                   sqlGenerator        = sqlGeneratorFactory.CreateDefault(databaseExpression);
            IRelationalValueBufferFactoryFactory valueBufferFactory  = dbContext.GetService <IRelationalValueBufferFactoryFactory>();

            return(dbReader => (TResult)materializer(sqlGenerator.CreateValueBufferFactory(valueBufferFactory, dbReader).Create(dbReader)));
        }
        public InMemoryQueryModelVisitor(
            [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] IMaterializerFactory materializerFactory,
            [NotNull] QueryCompilationContext queryCompilationContext)
            : 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(queryCompilationContext, nameof(queryCompilationContext)))
        {
            Check.NotNull(materializerFactory, nameof(materializerFactory));

            _materializerFactory = materializerFactory;
        }
        public RelationalEntityQueryableExpressionVisitorFactory(
            [NotNull] IModel model,
            [NotNull] IKeyValueFactorySource keyValueFactorySource,
            [NotNull] ISelectExpressionFactory selectExpressionFactory,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] ICommandBuilderFactory commandBuilderFactory,
            [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider)
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(keyValueFactorySource, nameof(keyValueFactorySource));
            Check.NotNull(selectExpressionFactory, nameof(selectExpressionFactory));
            Check.NotNull(materializerFactory, nameof(materializerFactory));
            Check.NotNull(commandBuilderFactory, nameof(commandBuilderFactory));
            Check.NotNull(relationalAnnotationProvider, nameof(relationalAnnotationProvider));

            _model = model;
            _keyValueFactorySource = keyValueFactorySource;
            _selectExpressionFactory = selectExpressionFactory;
            _materializerFactory = materializerFactory;
            _commandBuilderFactory = commandBuilderFactory;
            _relationalAnnotationProvider = relationalAnnotationProvider;
        }
        /// <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 IncludeExpressionVisitorFactory(
            [NotNull] ISelectExpressionFactory selectExpressionFactory,
            [NotNull] ICompositePredicateExpressionVisitorFactory compositePredicateExpressionVisitorFactory,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] IShaperCommandContextFactory shaperCommandContextFactory,
            [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider,
            [NotNull] IQuerySqlGeneratorFactory querySqlGeneratorFactory)
        {
            Check.NotNull(selectExpressionFactory, nameof(selectExpressionFactory));
            Check.NotNull(compositePredicateExpressionVisitorFactory, nameof(compositePredicateExpressionVisitorFactory));
            Check.NotNull(materializerFactory, nameof(materializerFactory));
            Check.NotNull(shaperCommandContextFactory, nameof(shaperCommandContextFactory));
            Check.NotNull(relationalAnnotationProvider, nameof(relationalAnnotationProvider));
            Check.NotNull(querySqlGeneratorFactory, nameof(querySqlGeneratorFactory));

            _selectExpressionFactory = selectExpressionFactory;
            _compositePredicateExpressionVisitorFactory = compositePredicateExpressionVisitorFactory;
            _materializerFactory = materializerFactory;
            _shaperCommandContextFactory = shaperCommandContextFactory;
            _relationalAnnotationProvider = relationalAnnotationProvider;
            _querySqlGeneratorFactory = querySqlGeneratorFactory;
        }
        /// <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 IncludeExpressionVisitorFactory(
            [NotNull] SelectExpressionDependencies selectExpressionDependencies,
            [NotNull] ISelectExpressionFactory selectExpressionFactory,
            [NotNull] ICompositePredicateExpressionVisitorFactory compositePredicateExpressionVisitorFactory,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] IShaperCommandContextFactory shaperCommandContextFactory,
            [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider)
        {
            Check.NotNull(selectExpressionDependencies, nameof(selectExpressionDependencies));
            Check.NotNull(selectExpressionFactory, nameof(selectExpressionFactory));
            Check.NotNull(compositePredicateExpressionVisitorFactory, nameof(compositePredicateExpressionVisitorFactory));
            Check.NotNull(materializerFactory, nameof(materializerFactory));
            Check.NotNull(shaperCommandContextFactory, nameof(shaperCommandContextFactory));
            Check.NotNull(relationalAnnotationProvider, nameof(relationalAnnotationProvider));

            _selectExpressionDependencies = selectExpressionDependencies;
            _selectExpressionFactory      = selectExpressionFactory;
            _compositePredicateExpressionVisitorFactory = compositePredicateExpressionVisitorFactory;
            _materializerFactory          = materializerFactory;
            _shaperCommandContextFactory  = shaperCommandContextFactory;
            _relationalAnnotationProvider = relationalAnnotationProvider;
        }
Esempio n. 35
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 MySqlIncludeExpressionVisitorFactory(
     [NotNull] ISelectExpressionFactory selectExpressionFactory,
     [NotNull] ICompositePredicateExpressionVisitorFactory compositePredicateExpressionVisitorFactory,
     [NotNull] IMaterializerFactory materializerFactory,
     [NotNull] IShaperCommandContextFactory shaperCommandContextFactory,
     [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider,
     [NotNull] IQuerySqlGeneratorFactory querySqlGeneratorFactory) : base(
         selectExpressionFactory,
         compositePredicateExpressionVisitorFactory,
         materializerFactory,
         shaperCommandContextFactory,
         relationalAnnotationProvider,
         querySqlGeneratorFactory
         )
 {
     _selectExpressionFactory = selectExpressionFactory;
     _compositePredicateExpressionVisitorFactory = compositePredicateExpressionVisitorFactory;
     _materializerFactory          = materializerFactory;
     _shaperCommandContextFactory  = shaperCommandContextFactory;
     _relationalAnnotationProvider = relationalAnnotationProvider;
     _querySqlGeneratorFactory     = querySqlGeneratorFactory;
 }
Esempio n. 36
0
        public RelationalEntityQueryableExpressionVisitorFactory(
            [NotNull] IModel model,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] ISelectExpressionFactory selectExpressionFactory,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] ICommandBuilderFactory commandBuilderFactory,
            [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider)
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource));
            Check.NotNull(selectExpressionFactory, nameof(selectExpressionFactory));
            Check.NotNull(materializerFactory, nameof(materializerFactory));
            Check.NotNull(commandBuilderFactory, nameof(commandBuilderFactory));
            Check.NotNull(relationalAnnotationProvider, nameof(relationalAnnotationProvider));

            _model = model;
            _entityKeyFactorySource       = entityKeyFactorySource;
            _selectExpressionFactory      = selectExpressionFactory;
            _materializerFactory          = materializerFactory;
            _commandBuilderFactory        = commandBuilderFactory;
            _relationalAnnotationProvider = relationalAnnotationProvider;
        }
Esempio n. 37
0
        public InMemoryQueryModelVisitorFactory(
            [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] IMaterializerFactory materializerFactory)
            : base(
                model,
                queryOptimizer,
                navigationRewritingExpressionVisitorFactory,
                subQueryMemberPushDownExpressionVisitor,
                querySourceTracingExpressionVisitorFactory,
                entityResultFindingExpressionVisitorFactory,
                taskBlockingExpressionVisitor,
                memberAccessBindingExpressionVisitorFactory,
                orderingExpressionVisitorFactory,
                projectionExpressionVisitorFactory,
                entityQueryableExpressionVisitorFactory,
                queryAnnotationExtractor,
                resultOperatorHandler,
                entityMaterializerSource,
                expressionPrinter)
        {
            Check.NotNull(materializerFactory, nameof(materializerFactory));

            MaterializerFactory = materializerFactory;
        }
Esempio n. 38
0
        public RelationalEntityQueryableExpressionVisitor(
            [NotNull] IModel model,
            [NotNull] ISelectExpressionFactory selectExpressionFactory,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] IShaperCommandContextFactory shaperCommandContextFactory,
            [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider,
            [NotNull] RelationalQueryModelVisitor queryModelVisitor,
            [CanBeNull] IQuerySource querySource)
            : base(Check.NotNull(queryModelVisitor, nameof(queryModelVisitor)))
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(selectExpressionFactory, nameof(selectExpressionFactory));
            Check.NotNull(materializerFactory, nameof(materializerFactory));
            Check.NotNull(shaperCommandContextFactory, nameof(shaperCommandContextFactory));
            Check.NotNull(relationalAnnotationProvider, nameof(relationalAnnotationProvider));

            _model = model;
            _selectExpressionFactory      = selectExpressionFactory;
            _materializerFactory          = materializerFactory;
            _shaperCommandContextFactory  = shaperCommandContextFactory;
            _relationalAnnotationProvider = relationalAnnotationProvider;
            _querySource = querySource;
        }