/// <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 FileContextValueGeneratorSelector(
     [NotNull] ValueGeneratorSelectorDependencies dependencies,
     [NotNull] IFileContextDatabase inMemoryDatabase)
     : base(dependencies)
 {
     _inMemoryStore = inMemoryDatabase.Store;
 }
Ejemplo n.º 2
0
        private static IEnumerable <TEntity> EntityQuery <TEntity>(
            QueryContext queryContext,
            IEntityType entityType,
            IKey key,
            Func <IEntityType, ValueBuffer, object> materializer,
            bool queryStateManager)
            where TEntity : class
        {
            IFileContextStore store = ((FileContextQueryContext)queryContext).Store;

            IReadOnlyList <FileContextTableSnapshot> tables = store.GetTables(entityType);


            return(tables.SelectMany(
                       t =>
                       t.Rows.Select(
                           vs =>
            {
                ValueBuffer valueBuffer = new ValueBuffer(vs);

                return (TEntity)queryContext
                .QueryBuffer
                .GetEntity(
                    key,
                    new EntityLoadInfo(
                        valueBuffer,
                        vr => materializer(t.EntityType, vr)),
                    queryStateManager,
                    throwOnNullKey: false);
            })));
        }
 public FileContextQueryContextFactory(
     [NotNull] QueryContextDependencies dependencies,
     [NotNull] IFileContextStoreCache storeCache,
     [NotNull] IDbContextOptions contextOptions)
 {
     _store        = storeCache.GetStore(contextOptions);
     _dependencies = dependencies;
 }
Ejemplo n.º 4
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 FileContextQueryContextFactory(
     [NotNull] QueryContextDependencies dependencies,
     [NotNull] IFileContextStoreCache storeCache,
     [NotNull] IDbContextOptions contextOptions)
     : base(dependencies)
 {
     _store = storeCache.GetStore(contextOptions.Extensions.OfType <FileContextOptionsExtension>().First());
 }
        /// <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 IFileContextStore GetStore()
        {
            if (_store == null)
            {
                _store = new FileContextStore(_tableFactory);
            }

            return(_store);
        }
Ejemplo n.º 6
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 FileContextDatabase(
            [NotNull] DatabaseDependencies dependencies,
            [NotNull] IFileContextStoreCache 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;
        }
Ejemplo 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 FileContextQueryContext(
     [NotNull] QueryContextDependencies dependencies,
     [NotNull] Func <IQueryBuffer> queryBufferFactory,
     [NotNull] IFileContextStore store)
     : base(dependencies, queryBufferFactory)
     => Store = store;
Ejemplo n.º 8
0
 public FileContextQueryContext([NotNull] QueryContextDependencies dependencies,
                                [NotNull] IFileContextStore store)
     : base(dependencies)
     => Store = store;