/// <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 InMemoryQueryContext(
     QueryContextDependencies dependencies,
     IInMemoryStore store)
     : base(dependencies)
 {
     Store = store;
 }
Exemple #2
0
 /// <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 InMemoryQueryContext(
     [NotNull] QueryContextDependencies dependencies,
     // Internal code: see #15096
     [NotNull] Func <IQueryBuffer> queryBufferFactory,
     [NotNull] IInMemoryStore store)
     : base(dependencies, queryBufferFactory)
     => Store = store;
Exemple #3
0
 /// <summary>
 ///     This API supports the Entity Framework Core infrastructure and is not intended to be used
 ///     directly from your code. This API may change or be removed in future releases.
 /// </summary>
 public InMemoryValueGeneratorSelector(
     [NotNull] ValueGeneratorSelectorDependencies dependencies,
     [NotNull] IInMemoryDatabase inMemoryDatabase)
     : base(dependencies)
 {
     _inMemoryStore = inMemoryDatabase.Store;
 }
Exemple #4
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));
        }
 /// <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 InMemoryQueryContext(
     [NotNull] QueryContextDependencies dependencies,
     [NotNull] Func <IQueryBuffer> queryBufferFactory,
     [NotNull] IInMemoryStore store)
     : base(dependencies, queryBufferFactory)
 {
     Store = store;
 }
Exemple #6
0
 /// <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 InMemoryQueryContextFactory(
     [NotNull] QueryContextDependencies dependencies,
     [NotNull] IInMemoryStoreCache storeCache,
     [NotNull] IDbContextOptions contextOptions)
     : base(dependencies)
 {
     _store = storeCache.GetStore(contextOptions);
 }
 /// <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 InMemoryQueryContextFactory(
     QueryContextDependencies dependencies,
     IInMemoryStoreCache storeCache,
     IDbContextOptions contextOptions)
 {
     _store       = storeCache.GetStore(contextOptions);
     Dependencies = dependencies;
 }
Exemple #8
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 InMemoryQueryContextFactory(
     [NotNull] ICurrentDbContext currentContext,
     [NotNull] IConcurrencyDetector concurrencyDetector,
     [NotNull] IInMemoryStoreSource storeSource,
     [NotNull] IDbContextOptions contextOptions)
     : base(currentContext, concurrencyDetector)
 {
     _store = storeSource.GetStore(contextOptions);
 }
 /// <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 InMemoryQueryContextFactory(
     [NotNull] IStateManager stateManager,
     [NotNull] IConcurrencyDetector concurrencyDetector,
     [NotNull] IInMemoryStoreSource storeSource,
     [NotNull] IChangeDetector changeDetector,
     [NotNull] IDbContextOptions contextOptions)
     : base(stateManager, concurrencyDetector, changeDetector)
 {
     _store = storeSource.GetStore(contextOptions);
 }
Exemple #10
0
 public InMemoryQueryContext(
     [NotNull] ILogger logger,
     [NotNull] IQueryBuffer queryBuffer,
     [NotNull] IInMemoryStore store)
     : base(
         Check.NotNull(logger, nameof(logger)),
         Check.NotNull(queryBuffer, nameof(queryBuffer)))
 {
     Store = store;
 }
 public InMemoryQueryContextFactory(
     [NotNull] IStateManager stateManager,
     [NotNull] IConcurrencyDetector concurrencyDetector,
     [NotNull] IInMemoryStoreSource storeSource,
     [NotNull] IChangeDetector changeDetector,
     [NotNull] IDbContextOptions contextOptions)
     : base(stateManager, concurrencyDetector, changeDetector)
 {
     _store = storeSource.GetStore(contextOptions);
 }
        public InMemoryDatabase(
            [NotNull] IQueryCompilationContextFactory queryCompilationContextFactory,
            [NotNull] IInMemoryStore persistentStore,
            [NotNull] IDbContextOptions options)
            : base(queryCompilationContextFactory)
        {
            Check.NotNull(queryCompilationContextFactory, nameof(queryCompilationContextFactory));
            Check.NotNull(persistentStore, nameof(persistentStore));
            Check.NotNull(options, nameof(options));

            _database = persistentStore;
        }
 /// <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 InMemoryQueryContext(
     [NotNull] Func <IQueryBuffer> queryBufferFactory,
     [NotNull] IInMemoryStore store,
     [NotNull] LazyRef <IStateManager> stateManager,
     [NotNull] IConcurrencyDetector concurrencyDetector)
     : base(
         Check.NotNull(queryBufferFactory, nameof(queryBufferFactory)),
         Check.NotNull(stateManager, nameof(stateManager)),
         Check.NotNull(concurrencyDetector, nameof(concurrencyDetector)))
 {
     Store = store;
 }
        /// <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 InMemoryDatabase(
            [NotNull] DatabaseDependencies dependencies,
            [NotNull] IInMemoryStoreSource storeSource,
            [NotNull] IDbContextOptions options,
            [NotNull] ILogger <InMemoryDatabase> logger)
            : base(dependencies)
        {
            Check.NotNull(storeSource, nameof(storeSource));
            Check.NotNull(options, nameof(options));
            Check.NotNull(logger, nameof(logger));

            _store  = storeSource.GetStore(options);
            _logger = logger;
        }
Exemple #15
0
 /// <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 InMemoryDatabase(
     DatabaseDependencies dependencies,
     IInMemoryStoreCache storeCache,
     IDbContextOptions options,
     IDesignTimeModel designTimeModel,
     IUpdateAdapterFactory updateAdapterFactory,
     IDiagnosticsLogger <DbLoggerCategory.Update> updateLogger)
     : base(dependencies)
 {
     _store                = storeCache.GetStore(options);
     _designTimeModel      = designTimeModel;
     _updateAdapterFactory = updateAdapterFactory;
     _updateLogger         = updateLogger;
 }
Exemple #16
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 InMemoryDatabase(
            [NotNull] DatabaseDependencies dependencies,
            [NotNull] IInMemoryStoreSource storeSource,
            [NotNull] IDbContextOptions options,
            [NotNull] IInterceptingLogger <LoggerCategory.Update> updateLogger)
            : base(dependencies)
        {
            Check.NotNull(storeSource, nameof(storeSource));
            Check.NotNull(options, nameof(options));
            Check.NotNull(updateLogger, nameof(updateLogger));

            _store        = storeSource.GetStore(options);
            _updateLogger = updateLogger;
        }
        /// <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 InMemoryDatabase(
            [NotNull] DatabaseDependencies dependencies,
            [NotNull] IInMemoryStoreCache storeCache,
            [NotNull] IDbContextOptions options,
            [NotNull] IDiagnosticsLogger <DbLoggerCategory.Update> updateLogger)
            : base(dependencies)
        {
            Check.NotNull(storeCache, nameof(storeCache));
            Check.NotNull(options, nameof(options));
            Check.NotNull(updateLogger, nameof(updateLogger));

            _store        = storeCache.GetStore(options);
            _updateLogger = updateLogger;
        }
Exemple #18
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 InMemoryDatabase(
            [NotNull] IQueryCompilationContextFactory queryCompilationContextFactory,
            [NotNull] IInMemoryStoreSource storeSource,
            [NotNull] IDbContextOptions options,
            [NotNull] ILogger <InMemoryDatabase> logger)
            : base(queryCompilationContextFactory)
        {
            Check.NotNull(queryCompilationContextFactory, nameof(queryCompilationContextFactory));
            Check.NotNull(storeSource, nameof(storeSource));
            Check.NotNull(options, nameof(options));
            Check.NotNull(logger, nameof(logger));

            _store  = storeSource.GetStore(options);
            _logger = logger;
        }
Exemple #19
0
        /// <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 InMemoryDatabase(
            DatabaseDependencies dependencies,
            IInMemoryStoreCache storeCache,
            IDbContextOptions options,
            ICurrentDbContext context,
            IUpdateAdapterFactory updateAdapterFactory,
            IDiagnosticsLogger <DbLoggerCategory.Update> updateLogger)
            : base(dependencies)
        {
            Check.NotNull(storeCache, nameof(storeCache));
            Check.NotNull(options, nameof(options));
            Check.NotNull(updateAdapterFactory, nameof(updateAdapterFactory));
            Check.NotNull(updateLogger, nameof(updateLogger));

            _store                = storeCache.GetStore(options);
            _getDesignModel       = () => context.Context.DesignTimeModel;
            _updateAdapterFactory = updateAdapterFactory;
            _updateLogger         = updateLogger;
        }
Exemple #20
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 virtual IInMemoryStore GetTransientStore()
 => _transientStore ?? (_transientStore = new InMemoryStore(_tableFactory));
Exemple #21
0
 /// <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 InMemoryQueryContext([NotNull] QueryContextDependencies dependencies,
                             [NotNull] IInMemoryStore store)
     : base(dependencies)
     => Store = store;
 public InMemoryQueryContext([NotNull] Func <IQueryBuffer> queryBufferFactory, [NotNull] IInMemoryStore store)
     : base(Check.NotNull(queryBufferFactory, nameof(queryBufferFactory)))
 {
     Store = store;
 }
 public InMemoryRepository(IInMemoryStore store)
 {
     _store = store;
 }