protected RelationalDataStore(
            [NotNull] IModel model,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IEntityMaterializerSource entityMaterializerSource,
            [NotNull] IClrAccessorSource <IClrPropertyGetter> clrPropertyGetterSource,
            [NotNull] IRelationalConnection connection,
            [NotNull] ICommandBatchPreparer batchPreparer,
            [NotNull] IBatchExecutor batchExecutor,
            [NotNull] IEntityOptions options,
            [NotNull] ILoggerFactory loggerFactory,
            [NotNull] IRelationalValueBufferFactoryFactory valueBufferFactoryFactory)
            : base(
                Check.NotNull(model, nameof(model)),
                Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource)),
                Check.NotNull(entityMaterializerSource, nameof(entityMaterializerSource)),
                Check.NotNull(clrPropertyGetterSource, nameof(clrPropertyGetterSource)),
                Check.NotNull(loggerFactory, nameof(loggerFactory)))
        {
            Check.NotNull(connection, nameof(connection));
            Check.NotNull(batchPreparer, nameof(batchPreparer));
            Check.NotNull(batchExecutor, nameof(batchExecutor));
            Check.NotNull(options, nameof(options));
            Check.NotNull(options, nameof(options));
            Check.NotNull(valueBufferFactoryFactory, nameof(valueBufferFactoryFactory));

            _batchPreparer = batchPreparer;
            _batchExecutor = batchExecutor;
            _connection    = connection;
            _options       = options;

            ValueBufferFactoryFactory = valueBufferFactoryFactory;
        }
Example #2
0
        public RelationalQueryCompilationContext(
            [NotNull] IModel model,
            [NotNull] ILogger logger,
            [NotNull] ILinqOperatorProvider linqOperatorProvider,
            [NotNull] IResultOperatorHandler resultOperatorHandler,
            [NotNull] IEntityMaterializerSource entityMaterializerSource,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IClrAccessorSource <IClrPropertyGetter> clrPropertyGetterSource,
            [NotNull] IQueryMethodProvider queryMethodProvider,
            [NotNull] IMethodCallTranslator compositeMethodCallTranslator,
            [NotNull] IMemberTranslator compositeMemberTranslator,
            [NotNull] IRelationalValueBufferFactoryFactory valueBufferFactoryFactory,
            [NotNull] IRelationalTypeMapper typeMapper)
            : base(
                model,
                logger,
                linqOperatorProvider,
                resultOperatorHandler,
                entityMaterializerSource,
                entityKeyFactorySource,
                clrPropertyGetterSource)

        {
            Check.NotNull(queryMethodProvider, nameof(queryMethodProvider));
            Check.NotNull(compositeMethodCallTranslator, nameof(compositeMethodCallTranslator));
            Check.NotNull(compositeMemberTranslator, nameof(compositeMemberTranslator));
            Check.NotNull(valueBufferFactoryFactory, nameof(valueBufferFactoryFactory));
            Check.NotNull(typeMapper, nameof(typeMapper));

            QueryMethodProvider           = queryMethodProvider;
            CompositeMethodCallTranslator = compositeMethodCallTranslator;
            CompositeMemberTranslator     = compositeMemberTranslator;
            ValueBufferFactoryFactory     = valueBufferFactoryFactory;
            TypeMapper = typeMapper;
        }
Example #3
0
 public EntityTrackingInfoFactory(
     [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
     [NotNull] IClrAccessorSource <IClrPropertyGetter> clrPropertyGetterSource)
 {
     _entityKeyFactorySource  = entityKeyFactorySource;
     _clrPropertyGetterSource = clrPropertyGetterSource;
 }
        protected QueryCompilationContext(
            [NotNull] IModel model,
            [NotNull] ILogger logger,
            [NotNull] ILinqOperatorProvider linqOperatorProvider,
            [NotNull] IResultOperatorHandler resultOperatorHandler,
            [NotNull] IEntityMaterializerSource entityMaterializerSource,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IClrAccessorSource <IClrPropertyGetter> clrPropertyGetterSource)
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(logger, nameof(logger));
            Check.NotNull(linqOperatorProvider, nameof(linqOperatorProvider));
            Check.NotNull(resultOperatorHandler, nameof(resultOperatorHandler));
            Check.NotNull(entityMaterializerSource, nameof(entityMaterializerSource));
            Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource));
            Check.NotNull(clrPropertyGetterSource, nameof(clrPropertyGetterSource));

            Model  = model;
            Logger = logger;
            LinqOperatorProvider     = linqOperatorProvider;
            ResultOperatorHandler    = resultOperatorHandler;
            EntityMaterializerSource = entityMaterializerSource;
            EntityKeyFactorySource   = entityKeyFactorySource;
            ClrPropertyGetterSource  = clrPropertyGetterSource;
        }
 public EntityTrackingInfoFactory(
     [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
     [NotNull] IClrAccessorSource<IClrPropertyGetter> clrPropertyGetterSource)
 {
     _entityKeyFactorySource = entityKeyFactorySource;
     _clrPropertyGetterSource = clrPropertyGetterSource;
 }
Example #6
0
        public RelationalQueryCompilationContext(
            [NotNull] IModel model,
            [NotNull] ILogger logger,
            [NotNull] ILinqOperatorProvider linqOperatorProvider,
            [NotNull] IResultOperatorHandler resultOperatorHandler,
            [NotNull] IEntityMaterializerSource entityMaterializerSource,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IClrAccessorSource <IClrPropertyGetter> clrPropertyGetterSource,
            [NotNull] IQueryMethodProvider queryMethodProvider,
            [NotNull] IMethodCallTranslator methodCallTranslator,
            [NotNull] IRelationalValueBufferFactoryFactory valueBufferFactoryFactory)
            : base(
                Check.NotNull(model, nameof(model)),
                Check.NotNull(logger, nameof(logger)),
                Check.NotNull(linqOperatorProvider, nameof(linqOperatorProvider)),
                Check.NotNull(resultOperatorHandler, nameof(resultOperatorHandler)),
                Check.NotNull(entityMaterializerSource, nameof(entityMaterializerSource)),
                Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource)),
                Check.NotNull(clrPropertyGetterSource, nameof(clrPropertyGetterSource)))
        {
            Check.NotNull(queryMethodProvider, nameof(queryMethodProvider));
            Check.NotNull(methodCallTranslator, nameof(methodCallTranslator));
            Check.NotNull(valueBufferFactoryFactory, nameof(valueBufferFactoryFactory));

            QueryMethodProvider       = queryMethodProvider;
            MethodCallTranslator      = methodCallTranslator;
            ValueBufferFactoryFactory = valueBufferFactoryFactory;
        }
 public SqlServerDatabase(
     [NotNull] IModel model,
     [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
     [NotNull] IEntityMaterializerSource entityMaterializerSource,
     [NotNull] IClrAccessorSource <IClrPropertyGetter> clrPropertyGetterSource,
     [NotNull] ISqlServerConnection connection,
     [NotNull] ICommandBatchPreparer batchPreparer,
     [NotNull] IBatchExecutor batchExecutor,
     [NotNull] IDbContextOptions options,
     [NotNull] ILoggerFactory loggerFactory,
     [NotNull] IRelationalValueBufferFactoryFactory valueBufferFactoryFactory,
     [NotNull] IMethodCallTranslator compositeMethodCallTranslator,
     [NotNull] IMemberTranslator compositeMemberTranslator,
     [NotNull] IRelationalTypeMapper typeMapper,
     [NotNull] IRelationalMetadataExtensionProvider relationalExtensions)
     : base(
         model,
         entityKeyFactorySource,
         entityMaterializerSource,
         clrPropertyGetterSource,
         connection,
         batchPreparer,
         batchExecutor,
         options,
         loggerFactory,
         valueBufferFactoryFactory,
         compositeMethodCallTranslator,
         compositeMemberTranslator,
         typeMapper,
         relationalExtensions)
 {
 }
 public SqlServerQueryCompilationContext(
     [NotNull] IModel model,
     [NotNull] ILogger logger,
     [NotNull] ILinqOperatorProvider linqOperatorProvider,
     [NotNull] IResultOperatorHandler resultOperatorHandler,
     [NotNull] IEntityMaterializerSource entityMaterializerSource,
     [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
     [NotNull] IClrAccessorSource <IClrPropertyGetter> clrPropertyGetterSource,
     [NotNull] IQueryMethodProvider queryMethodProvider,
     [NotNull] IMethodCallTranslator compositeMethodCallTranslator,
     [NotNull] IMemberTranslator compositeMemberTranslator,
     [NotNull] IRelationalValueBufferFactoryFactory valueBufferFactoryFactory,
     [NotNull] IRelationalTypeMapper typeMapper,
     [NotNull] IRelationalMetadataExtensionProvider relationalExtensions)
     : base(
         model,
         logger,
         linqOperatorProvider,
         resultOperatorHandler,
         entityMaterializerSource,
         entityKeyFactorySource,
         clrPropertyGetterSource,
         queryMethodProvider,
         compositeMethodCallTranslator,
         compositeMemberTranslator,
         valueBufferFactoryFactory,
         typeMapper,
         relationalExtensions)
 {
 }
Example #9
0
        protected RelationalDataStore(
            [NotNull] IModel model,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IEntityMaterializerSource entityMaterializerSource,
            [NotNull] IRelationalConnection connection,
            [NotNull] CommandBatchPreparer batchPreparer,
            [NotNull] BatchExecutor batchExecutor,
            [NotNull] IDbContextOptions options,
            [NotNull] ILoggerFactory loggerFactory)
            : base(
                Check.NotNull(model, nameof(model)),
                Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource)),
                Check.NotNull(entityMaterializerSource, nameof(entityMaterializerSource)),
                Check.NotNull(loggerFactory, nameof(loggerFactory)))
        {
            Check.NotNull(connection, nameof(connection));
            Check.NotNull(batchPreparer, nameof(batchPreparer));
            Check.NotNull(batchExecutor, nameof(batchExecutor));
            Check.NotNull(options, nameof(options));

            _batchPreparer = batchPreparer;
            _batchExecutor = batchExecutor;
            _connection    = connection;
            _options       = options;
        }
Example #10
0
        public InMemoryDatabase(
            [NotNull] IModel model,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IEntityMaterializerSource entityMaterializerSource,
            [NotNull] IClrAccessorSource <IClrPropertyGetter> clrPropertyGetterSource,
            [NotNull] IInMemoryStore persistentStore,
            [NotNull] IDbContextOptions options,
            [NotNull] ILoggerFactory loggerFactory)
            : base(model, loggerFactory)
        {
            Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource));
            Check.NotNull(entityMaterializerSource, nameof(entityMaterializerSource));
            Check.NotNull(clrPropertyGetterSource, nameof(clrPropertyGetterSource));
            Check.NotNull(persistentStore, nameof(persistentStore));
            Check.NotNull(options, nameof(options));
            Check.NotNull(loggerFactory, nameof(loggerFactory));

            _entityKeyFactorySource   = entityKeyFactorySource;
            _entityMaterializerSource = entityMaterializerSource;
            _clrPropertyGetterSource  = clrPropertyGetterSource;

            var storeConfig = options.Extensions
                              .OfType <InMemoryOptionsExtension>()
                              .FirstOrDefault();

            _persist = storeConfig?.Persist ?? true;

            _database = new ThreadSafeLazyRef <IInMemoryStore>(
                () => _persist
                    ? persistentStore
                    : new InMemoryStore(loggerFactory));
        }
        public RelationalEntityQueryableExpressionVisitor(
            [NotNull] IModel model,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] ISelectExpressionFactory selectExpressionFactory,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] ICommandBuilderFactory commandBuilderFactory,
            [NotNull] IRelationalAnnotationProvider relationalAnnotationProvider,
            [NotNull] RelationalQueryModelVisitor queryModelVisitor,
            [NotNull] IQuerySource querySource)
            : base(Check.NotNull(queryModelVisitor, nameof(queryModelVisitor)))
        {
            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));
            Check.NotNull(querySource, nameof(querySource));

            _model = model;
            _entityKeyFactorySource       = entityKeyFactorySource;
            _selectExpressionFactory      = selectExpressionFactory;
            _materializerFactory          = materializerFactory;
            _commandBuilderFactory        = commandBuilderFactory;
            _relationalAnnotationProvider = relationalAnnotationProvider;
            _querySource = querySource;
        }
        public InMemoryDataStore(
            [NotNull] IModel model,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IEntityMaterializerSource entityMaterializerSource,
            [NotNull] InMemoryDatabase persistentDatabase,
            [NotNull] IDbContextOptions options,
            [NotNull] ILoggerFactory loggerFactory)
            : base(
                Check.NotNull(model, nameof(model)),
                Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource)),
                Check.NotNull(entityMaterializerSource, nameof(entityMaterializerSource)),
                Check.NotNull(loggerFactory, nameof(loggerFactory)))
        {
            Check.NotNull(persistentDatabase, nameof(persistentDatabase));

            var storeConfig = options.Extensions
                              .OfType <InMemoryOptionsExtension>()
                              .FirstOrDefault();

            _persist = storeConfig?.Persist ?? true;

            _database = new ThreadSafeLazyRef <InMemoryDatabase>(
                () => _persist
                    ? persistentDatabase
                    : new InMemoryDatabase(loggerFactory));
        }
Example #13
0
 public FakeRelationalDatabase(
     IModel model,
     IEntityKeyFactorySource entityKeyFactorySource,
     IEntityMaterializerSource entityMaterializerSource,
     IClrAccessorSource <IClrPropertyGetter> clrPropertyGetterSource,
     IRelationalConnection connection,
     ICommandBatchPreparer batchPreparer,
     IBatchExecutor batchExecutor,
     IDbContextOptions options,
     ILoggerFactory loggerFactory,
     IRelationalValueBufferFactoryFactory valueBufferFactoryFactory,
     IMethodCallTranslator compositeMethodCallTranslator,
     IMemberTranslator compositeMemberTranslator,
     IRelationalTypeMapper typeMapper)
     : base(
         model,
         entityKeyFactorySource,
         entityMaterializerSource,
         clrPropertyGetterSource,
         connection,
         batchPreparer,
         batchExecutor,
         options,
         loggerFactory,
         valueBufferFactoryFactory,
         compositeMethodCallTranslator,
         compositeMemberTranslator,
         typeMapper)
 {
 }
 public TestSqlServerQueryContextFactory(
     IStateManager stateManager,
     IEntityKeyFactorySource entityKeyFactorySource,
     IClrCollectionAccessorSource collectionAccessorSource,
     IClrAccessorSource <IClrPropertySetter> propertySetterSource,
     ISqlServerConnection connection,
     ILoggerFactory loggerFactory)
     : base(stateManager, entityKeyFactorySource, collectionAccessorSource, propertySetterSource, connection, loggerFactory)
 {
 }
Example #15
0
 public NpgsqlQueryContextFactory(
     [NotNull] IStateManager stateManager,
     [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
     [NotNull] IClrCollectionAccessorSource collectionAccessorSource,
     [NotNull] IClrAccessorSource <IClrPropertySetter> propertySetterSource,
     [NotNull] INpgsqlEFConnection connection,
     [NotNull] ILoggerFactory loggerFactory)
     : base(stateManager, entityKeyFactorySource, collectionAccessorSource, propertySetterSource, connection, loggerFactory)
 {
 }
 public RelationalQueryContextFactory(
     [NotNull] IStateManager stateManager,
     [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
     [NotNull] IClrCollectionAccessorSource collectionAccessorSource,
     [NotNull] IClrAccessorSource <IClrPropertySetter> propertySetterSource,
     [NotNull] IRelationalConnection connection)
     : base(stateManager, entityKeyFactorySource, collectionAccessorSource, propertySetterSource)
 {
     _connection = connection;
 }
Example #17
0
 public QueryBuffer(
     [NotNull] IStateManager stateManager,
     [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
     [NotNull] IClrCollectionAccessorSource clrCollectionAccessorSource,
     [NotNull] IClrAccessorSource<IClrPropertySetter> clrPropertySetterSource)
 {
     _stateManager = stateManager;
     _entityKeyFactorySource = entityKeyFactorySource;
     _clrCollectionAccessorSource = clrCollectionAccessorSource;
     _clrPropertySetterSource = clrPropertySetterSource;
 }
Example #18
0
 public ThrowingMonsterStateManager(
     IInternalEntityEntryFactory factory,
     IEntityKeyFactorySource entityKeyFactorySource,
     IInternalEntityEntrySubscriber subscriber,
     IInternalEntityEntryNotifier notifier,
     IValueGenerationManager valueGeneration,
     IModel model,
     IDataStore dataStore)
     : base(factory, entityKeyFactorySource, subscriber, notifier, valueGeneration, model, dataStore)
 {
 }
Example #19
0
 public QueryBuffer(
     [NotNull] IStateManager stateManager,
     [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
     [NotNull] IClrCollectionAccessorSource clrCollectionAccessorSource,
     [NotNull] IClrAccessorSource <IClrPropertySetter> clrPropertySetterSource)
 {
     _stateManager                = stateManager;
     _entityKeyFactorySource      = entityKeyFactorySource;
     _clrCollectionAccessorSource = clrCollectionAccessorSource;
     _clrPropertySetterSource     = clrPropertySetterSource;
 }
 public ThrowingMonsterStateManager(
     IInternalEntityEntryFactory factory,
     IEntityKeyFactorySource entityKeyFactorySource,
     IInternalEntityEntrySubscriber subscriber,
     IInternalEntityEntryNotifier notifier,
     IValueGenerationManager valueGeneration,
     IModel model,
     IDataStore dataStore)
     : base(factory, entityKeyFactorySource, subscriber, notifier, valueGeneration, model, dataStore)
 {
 }
Example #21
0
 public FakeRelationalDataStore(
     IModel model,
     IEntityKeyFactorySource entityKeyFactorySource,
     IEntityMaterializerSource entityMaterializerSource,
     IRelationalConnection connection,
     CommandBatchPreparer batchPreparer,
     BatchExecutor batchExecutor,
     IDbContextOptions options,
     ILoggerFactory loggerFactory)
     : base(model, entityKeyFactorySource, entityMaterializerSource, connection, batchPreparer, batchExecutor, options, loggerFactory)
 {
 }
 public FakeRelationalDataStore(
     IModel model,
     IEntityKeyFactorySource entityKeyFactorySource,
     IEntityMaterializerSource entityMaterializerSource,
     IRelationalConnection connection,
     CommandBatchPreparer batchPreparer,
     BatchExecutor batchExecutor,
     IDbContextOptions options,
     ILoggerFactory loggerFactory)
     : base(model, entityKeyFactorySource, entityMaterializerSource, connection, batchPreparer, batchExecutor, options, loggerFactory)
 {
 }
        public InMemoryQueryContextFactory(
            [NotNull] IStateManager stateManager,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IClrCollectionAccessorSource collectionAccessorSource,
            [NotNull] IClrAccessorSource <IClrPropertySetter> propertySetterSource,
            [NotNull] IInMemoryDatabase database)
            : base(stateManager, entityKeyFactorySource, collectionAccessorSource, propertySetterSource)
        {
            Check.NotNull(database, nameof(database));

            _database = database;
        }
        public InMemoryEntityQueryableExpressionVisitorFactory(
            [NotNull] IModel model,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IMaterializerFactory materializerFactory)
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource));
            Check.NotNull(materializerFactory, nameof(materializerFactory));

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

            _model = model;
            _entityKeyFactorySource = entityKeyFactorySource;
            _materializerFactory    = materializerFactory;
        }
Example #26
0
        public RelationalQueryContextFactory(
            [NotNull] IStateManager stateManager,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IClrCollectionAccessorSource collectionAccessorSource,
            [NotNull] IClrAccessorSource <IClrPropertySetter> propertySetterSource,
            [NotNull] IRelationalConnection connection,
            [NotNull] ILoggerFactory loggerFactory)
            : base(stateManager, entityKeyFactorySource, collectionAccessorSource, propertySetterSource, loggerFactory)
        {
            Check.NotNull(connection, nameof(connection));

            _connection = connection;
        }
Example #27
0
 public NpgsqlDataStore(
     [NotNull] IModel model,
     [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
     [NotNull] IEntityMaterializerSource entityMaterializerSource,
     [NotNull] NpgsqlEntityFrameworkConnection connection,
     [NotNull] NpgsqlCommandBatchPreparer batchPreparer,
     [NotNull] NpgsqlBatchExecutor batchExecutor,
     [NotNull] IDbContextOptions options,
     [NotNull] ILoggerFactory loggerFactory)
     : base(model, entityKeyFactorySource, entityMaterializerSource,
            connection, batchPreparer, batchExecutor, options, loggerFactory)
 {
 }
Example #28
0
        public EntityTrackingInfo(
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IClrAccessorSource <IClrPropertyGetter> clrPropertyGetterSource,
            [NotNull] QueryCompilationContext queryCompilationContext,
            [NotNull] QuerySourceReferenceExpression querySourceReferenceExpression,
            [NotNull] IEntityType entityType)
        {
            Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource));
            Check.NotNull(clrPropertyGetterSource, nameof(clrPropertyGetterSource));
            Check.NotNull(querySourceReferenceExpression, nameof(querySourceReferenceExpression));
            Check.NotNull(entityType, nameof(entityType));
            Check.NotNull(queryCompilationContext, nameof(queryCompilationContext));

            QuerySourceReferenceExpression = querySourceReferenceExpression;

            _entityType = entityType;
            _queryCompilationContext = queryCompilationContext;
            _entityKeyFactorySource  = entityKeyFactorySource;
            _clrPropertyGetterSource = clrPropertyGetterSource;

            _entityKeyProperties = _entityType.GetPrimaryKey().Properties;

            _entityKeyFactory = _entityKeyFactorySource.GetKeyFactory(_entityType.GetPrimaryKey());

            _includedNavigationPaths
                = _queryCompilationContext
                  .GetTrackableIncludes(querySourceReferenceExpression.ReferencedQuerySource);

            if (_includedNavigationPaths != null)
            {
                _includedEntityTrackingInfos = new Dictionary <INavigation, IncludedEntityTrackingInfo>();

                foreach (var navigation
                         in _includedNavigationPaths.SelectMany(ns => ns))
                {
                    if (!_includedEntityTrackingInfos.ContainsKey(navigation))
                    {
                        var targetEntityType = navigation.GetTargetType();
                        var targetKey        = targetEntityType.GetPrimaryKey();

                        _includedEntityTrackingInfos.Add(
                            navigation,
                            new IncludedEntityTrackingInfo(
                                targetEntityType,
                                _entityKeyFactorySource.GetKeyFactory(targetKey),
                                targetKey.Properties));
                    }
                }
            }
        }
        public EntityTrackingInfo(
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IClrAccessorSource<IClrPropertyGetter> clrPropertyGetterSource,
            [NotNull] QueryCompilationContext queryCompilationContext,
            [NotNull] QuerySourceReferenceExpression querySourceReferenceExpression,
            [NotNull] IEntityType entityType)
        {
            Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource));
            Check.NotNull(clrPropertyGetterSource, nameof(clrPropertyGetterSource));
            Check.NotNull(querySourceReferenceExpression, nameof(querySourceReferenceExpression));
            Check.NotNull(entityType, nameof(entityType));
            Check.NotNull(queryCompilationContext, nameof(queryCompilationContext));

            QuerySourceReferenceExpression = querySourceReferenceExpression;

            _entityType = entityType;
            _queryCompilationContext = queryCompilationContext;
            _entityKeyFactorySource = entityKeyFactorySource;
            _clrPropertyGetterSource = clrPropertyGetterSource;

            _entityKeyProperties = _entityType.GetPrimaryKey().Properties;

            _entityKeyFactory = _entityKeyFactorySource.GetKeyFactory(_entityType.GetPrimaryKey());

            _includedNavigationPaths
                = _queryCompilationContext
                    .GetTrackableIncludes(querySourceReferenceExpression.ReferencedQuerySource);

            if (_includedNavigationPaths != null)
            {
                _includedEntityTrackingInfos = new Dictionary<INavigation, IncludedEntityTrackingInfo>();

                foreach (var navigation
                    in _includedNavigationPaths.SelectMany(ns => ns))
                {
                    if (!_includedEntityTrackingInfos.ContainsKey(navigation))
                    {
                        var targetEntityType = navigation.GetTargetType();
                        var targetKey = targetEntityType.GetPrimaryKey();

                        _includedEntityTrackingInfos.Add(
                            navigation,
                            new IncludedEntityTrackingInfo(
                                targetEntityType,
                                _entityKeyFactorySource.GetKeyFactory(targetKey),
                                targetKey.Properties));
                    }
                }
            }
        }
 public EntityEntryMetadataServices(
     [NotNull] IClrAccessorSource<IClrPropertyGetter> getterSource,
     [NotNull] IClrAccessorSource<IClrPropertySetter> setterSource,
     [NotNull] IOriginalValuesFactory originalValuesFactory,
     [NotNull] IRelationshipsSnapshotFactory relationshipsSnapshotFactory,
     [NotNull] IStoreGeneratedValuesFactory storeGeneratedValuesFactory,
     [NotNull] IEntityKeyFactorySource entityKeyFactorySource)
 {
     _getterSource = getterSource;
     _setterSource = setterSource;
     _originalValuesFactory = originalValuesFactory;
     _relationshipsSnapshotFactory = relationshipsSnapshotFactory;
     _storeGeneratedValuesFactory = storeGeneratedValuesFactory;
     _entityKeyFactorySource = entityKeyFactorySource;
 }
 public EntityEntryMetadataServices(
     [NotNull] IClrAccessorSource <IClrPropertyGetter> getterSource,
     [NotNull] IClrAccessorSource <IClrPropertySetter> setterSource,
     [NotNull] IOriginalValuesFactory originalValuesFactory,
     [NotNull] IRelationshipsSnapshotFactory relationshipsSnapshotFactory,
     [NotNull] IStoreGeneratedValuesFactory storeGeneratedValuesFactory,
     [NotNull] IEntityKeyFactorySource entityKeyFactorySource)
 {
     _getterSource                 = getterSource;
     _setterSource                 = setterSource;
     _originalValuesFactory        = originalValuesFactory;
     _relationshipsSnapshotFactory = relationshipsSnapshotFactory;
     _storeGeneratedValuesFactory  = storeGeneratedValuesFactory;
     _entityKeyFactorySource       = entityKeyFactorySource;
 }
 public InMemoryQueryCompilationContext(
     [NotNull] IModel model,
     [NotNull] ILogger logger,
     [NotNull] IEntityMaterializerSource entityMaterializerSource,
     [NotNull] IEntityKeyFactorySource entityKeyFactorySource)
     : base(
         Check.NotNull(model, nameof(model)),
         Check.NotNull(logger, nameof(logger)),
         new LinqOperatorProvider(),
         new ResultOperatorHandler(),
         Check.NotNull(entityMaterializerSource, nameof(entityMaterializerSource)),
         Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource)))
 {
     Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource));
 }
        protected QueryContextFactory(
            [NotNull] IStateManager stateManager,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IClrCollectionAccessorSource collectionAccessorSource,
            [NotNull] IClrAccessorSource <IClrPropertySetter> propertySetterSource)
        {
            Check.NotNull(stateManager, nameof(stateManager));
            Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource));
            Check.NotNull(collectionAccessorSource, nameof(collectionAccessorSource));
            Check.NotNull(propertySetterSource, nameof(propertySetterSource));

            _stateManager             = stateManager;
            _entityKeyFactorySource   = entityKeyFactorySource;
            _collectionAccessorSource = collectionAccessorSource;
            _propertySetterSource     = propertySetterSource;
        }
        public QueryBuffer(
            [NotNull] IStateManager stateManager,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IClrCollectionAccessorSource clrCollectionAccessorSource,
            [NotNull] IClrAccessorSource<IClrPropertySetter> clrPropertySetterSource)
        {
            Check.NotNull(stateManager, nameof(stateManager));
            Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource));
            Check.NotNull(clrCollectionAccessorSource, nameof(clrCollectionAccessorSource));
            Check.NotNull(clrPropertySetterSource, nameof(clrPropertySetterSource));

            _stateManager = stateManager;
            _entityKeyFactorySource = entityKeyFactorySource;
            _clrCollectionAccessorSource = clrCollectionAccessorSource;
            _clrPropertySetterSource = clrPropertySetterSource;
        }
        protected QueryContextFactory(
            [NotNull] IStateManager stateManager,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IClrCollectionAccessorSource collectionAccessorSource,
            [NotNull] IClrAccessorSource<IClrPropertySetter> propertySetterSource)
        {
            Check.NotNull(stateManager, nameof(stateManager));
            Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource));
            Check.NotNull(collectionAccessorSource, nameof(collectionAccessorSource));
            Check.NotNull(propertySetterSource, nameof(propertySetterSource));

            _stateManager = stateManager;
            _entityKeyFactorySource = entityKeyFactorySource;
            _collectionAccessorSource = collectionAccessorSource;
            _propertySetterSource = propertySetterSource;
        }
        public QueryBuffer(
            [NotNull] IStateManager stateManager,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IClrCollectionAccessorSource clrCollectionAccessorSource,
            [NotNull] IClrAccessorSource <IClrPropertySetter> clrPropertySetterSource)
        {
            Check.NotNull(stateManager, nameof(stateManager));
            Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource));
            Check.NotNull(clrCollectionAccessorSource, nameof(clrCollectionAccessorSource));
            Check.NotNull(clrPropertySetterSource, nameof(clrPropertySetterSource));

            _stateManager                = stateManager;
            _entityKeyFactorySource      = entityKeyFactorySource;
            _clrCollectionAccessorSource = clrCollectionAccessorSource;
            _clrPropertySetterSource     = clrPropertySetterSource;
        }
Example #37
0
 public StateManager(
     [NotNull] IInternalEntityEntryFactory factory,
     [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
     [NotNull] IInternalEntityEntrySubscriber subscriber,
     [NotNull] IInternalEntityEntryNotifier notifier,
     [NotNull] IValueGenerationManager valueGeneration,
     [NotNull] IModel model,
     [NotNull] IDataStore dataStore)
 {
     _keyFactorySource = entityKeyFactorySource;
     _factory          = factory;
     _subscriber       = subscriber;
     Notify            = notifier;
     ValueGeneration   = valueGeneration;
     _model            = model;
     _dataStore        = dataStore;
 }
Example #38
0
 public StateManager(
     [NotNull] IInternalEntityEntryFactory factory,
     [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
     [NotNull] IInternalEntityEntrySubscriber subscriber,
     [NotNull] IInternalEntityEntryNotifier notifier,
     [NotNull] IValueGenerationManager valueGeneration,
     [NotNull] IModel model,
     [NotNull] IDataStore dataStore)
 {
     _keyFactorySource = entityKeyFactorySource;
     _factory = factory;
     _subscriber = subscriber;
     Notify = notifier;
     ValueGeneration = valueGeneration;
     _model = model;
     _dataStore = dataStore;
 }
        protected RelationalDatabase(
            [NotNull] IModel model,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IEntityMaterializerSource entityMaterializerSource,
            [NotNull] IClrAccessorSource <IClrPropertyGetter> clrPropertyGetterSource,
            [NotNull] IRelationalConnection connection,
            [NotNull] ICommandBatchPreparer batchPreparer,
            [NotNull] IBatchExecutor batchExecutor,
            [NotNull] IDbContextOptions options,
            [NotNull] ILoggerFactory loggerFactory,
            [NotNull] IRelationalValueBufferFactoryFactory valueBufferFactoryFactory,
            [NotNull] IMethodCallTranslator compositeMethodCallTranslator,
            [NotNull] IMemberTranslator compositeMemberTranslator,
            [NotNull] IRelationalTypeMapper typeMapper,
            [NotNull] IRelationalMetadataExtensionProvider relationalExtensions)
            : base(model, loggerFactory)
        {
            Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource));
            Check.NotNull(entityMaterializerSource, nameof(entityMaterializerSource));
            Check.NotNull(clrPropertyGetterSource, nameof(clrPropertyGetterSource));
            Check.NotNull(connection, nameof(connection));
            Check.NotNull(batchPreparer, nameof(batchPreparer));
            Check.NotNull(batchExecutor, nameof(batchExecutor));
            Check.NotNull(options, nameof(options));
            Check.NotNull(valueBufferFactoryFactory, nameof(valueBufferFactoryFactory));
            Check.NotNull(compositeMethodCallTranslator, nameof(compositeMethodCallTranslator));
            Check.NotNull(compositeMemberTranslator, nameof(compositeMemberTranslator));
            Check.NotNull(typeMapper, nameof(typeMapper));
            Check.NotNull(relationalExtensions, nameof(relationalExtensions));

            EntityKeyFactorySource   = entityKeyFactorySource;
            EntityMaterializerSource = entityMaterializerSource;
            ClrPropertyGetterSource  = clrPropertyGetterSource;

            _batchPreparer = batchPreparer;
            _batchExecutor = batchExecutor;
            _connection    = connection;
            _options       = options;
            _compositeMethodCallTranslator = compositeMethodCallTranslator;
            _compositeMemberTranslator     = compositeMemberTranslator;

            TypeMapper = typeMapper;
            ValueBufferFactoryFactory = valueBufferFactoryFactory;
            RelationalExtensions      = relationalExtensions;
        }
        public InMemoryEntityQueryableExpressionVisitor(
            [NotNull] IModel model,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] EntityQueryModelVisitor entityQueryModelVisitor,
            [NotNull] IQuerySource querySource)
            : base(Check.NotNull(entityQueryModelVisitor, nameof(entityQueryModelVisitor)))
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource));
            Check.NotNull(materializerFactory, nameof(materializerFactory));
            Check.NotNull(querySource, nameof(querySource));

            _model = model;
            _entityKeyFactorySource = entityKeyFactorySource;
            _materializerFactory = materializerFactory;
            _querySource = querySource;
        }
Example #41
0
        public InMemoryEntityQueryableExpressionVisitor(
            [NotNull] IModel model,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IMaterializerFactory materializerFactory,
            [NotNull] EntityQueryModelVisitor entityQueryModelVisitor,
            [NotNull] IQuerySource querySource)
            : base(Check.NotNull(entityQueryModelVisitor, nameof(entityQueryModelVisitor)))
        {
            Check.NotNull(model, nameof(model));
            Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource));
            Check.NotNull(materializerFactory, nameof(materializerFactory));
            Check.NotNull(querySource, nameof(querySource));

            _model = model;
            _entityKeyFactorySource = entityKeyFactorySource;
            _materializerFactory    = materializerFactory;
            _querySource            = querySource;
        }
        protected QueryContextFactory(
            [NotNull] IStateManager stateManager,
            [NotNull] IEntityKeyFactorySource entityKeyFactorySource,
            [NotNull] IClrCollectionAccessorSource collectionAccessorSource,
            [NotNull] IClrAccessorSource<IClrPropertySetter> propertySetterSource,
            [NotNull] ILoggerFactory loggerFactory)
        {
            Check.NotNull(stateManager, nameof(stateManager));
            Check.NotNull(entityKeyFactorySource, nameof(entityKeyFactorySource));
            Check.NotNull(collectionAccessorSource, nameof(collectionAccessorSource));
            Check.NotNull(propertySetterSource, nameof(propertySetterSource));
            Check.NotNull(loggerFactory, nameof(loggerFactory));

            _stateManager = stateManager;
            _entityKeyFactorySource = entityKeyFactorySource;
            _collectionAccessorSource = collectionAccessorSource;
            _propertySetterSource = propertySetterSource;

            _logger = new LazyRef<ILogger>(loggerFactory.CreateLogger<QueryContextFactory>);
        }
        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;
        }
 public FakeRelationalDataStore(
     IModel model,
     IEntityKeyFactorySource entityKeyFactorySource,
     IEntityMaterializerSource entityMaterializerSource,
     IClrAccessorSource<IClrPropertyGetter> clrPropertyGetterSource,
     IRelationalConnection connection,
     ICommandBatchPreparer batchPreparer,
     IBatchExecutor batchExecutor,
     IEntityOptions options,
     ILoggerFactory loggerFactory,
     IRelationalValueBufferFactoryFactory valueBufferFactoryFactory)
     : base(
           model, 
           entityKeyFactorySource, 
           entityMaterializerSource,
           clrPropertyGetterSource,
           connection, 
           batchPreparer, 
           batchExecutor, 
           options, 
           loggerFactory,
           valueBufferFactoryFactory)
 {
 }
 public FakeRelationalDatabase(
     IModel model,
     IEntityKeyFactorySource entityKeyFactorySource,
     IEntityMaterializerSource entityMaterializerSource,
     IClrAccessorSource<IClrPropertyGetter> clrPropertyGetterSource,
     IRelationalConnection connection,
     ICommandBatchPreparer batchPreparer,
     IBatchExecutor batchExecutor,
     IDbContextOptions options,
     ILoggerFactory loggerFactory,
     IRelationalValueBufferFactoryFactory valueBufferFactoryFactory,
     IMethodCallTranslator compositeMethodCallTranslator,
     IMemberTranslator compositeMemberTranslator,
     IRelationalTypeMapper typeMapper)
     : base(
           model, 
           entityKeyFactorySource, 
           entityMaterializerSource,
           clrPropertyGetterSource,
           connection, 
           batchPreparer, 
           batchExecutor, 
           options, 
           loggerFactory,
           valueBufferFactoryFactory,
           compositeMethodCallTranslator,
           compositeMemberTranslator,
           typeMapper)
 {
 }
 public FakeQueryCompilationContext(
     IModel model,
     ILogger logger,
     ILinqOperatorProvider linqOperatorProvider,
     IResultOperatorHandler resultOperatorHandler,
     IEntityMaterializerSource entityMaterializerSource,
     IClrAccessorSource<IClrPropertyGetter> clrPropertyGetterSource,
     IEntityKeyFactorySource entityKeyFactorySource,
     IQueryMethodProvider queryMethodProvider,
     IMethodCallTranslator compositeMethodCallTranslator,
     IMemberTranslator compositeMemberTranslator,
     IRelationalValueBufferFactoryFactory valueBufferFactoryFactory,
     IRelationalTypeMapper typeMapper,
     IRelationalMetadataExtensionProvider relationalExtensions)
     : base(
         model,
         logger,
         linqOperatorProvider,
         resultOperatorHandler,
         entityMaterializerSource,
         entityKeyFactorySource,
         clrPropertyGetterSource,
         queryMethodProvider,
         compositeMethodCallTranslator,
         compositeMemberTranslator,
         valueBufferFactoryFactory,
         typeMapper,
         relationalExtensions)
 {
 }