Пример #1
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 LiteDBStore(
     [NotNull] ILiteDBTableFactory tableFactory,
     bool useNameMatching,
     string name)
 {
     _tableFactory = tableFactory;
     LiteDatabase  = new LiteDB.LiteDatabase(name);
     _tableFactory.LiteDatabase = LiteDatabase;
     _useNameMatching           = useNameMatching;
     _tables = CreateTables();
 }
Пример #2
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 LiteDBStoreCache(
            [NotNull] ILiteDBTableFactory tableFactory,
            [CanBeNull] ILiteDBSingletonOptions options)
        {
            _tableFactory = tableFactory;
            if (options?.DatabaseRoot != null)
            {
                _useNameMatching = true;

                LazyInitializer.EnsureInitialized(
                    ref options.DatabaseRoot.Instance,
                    () => new ConcurrentDictionary <string, ILiteDBStore>());

                _namedStores = (ConcurrentDictionary <string, ILiteDBStore>)options.DatabaseRoot.Instance;
            }
            else
            {
                _namedStores = new ConcurrentDictionary <string, ILiteDBStore>();
            }
        }
Пример #3
0
 public LiteDBStoreCache([NotNull] ILiteDBTableFactory tableFactory)
     : this(tableFactory, null)
 {
 }
Пример #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 LiteDBStore([NotNull] ILiteDBTableFactory tableFactory, string name)
     : this(tableFactory, useNameMatching : false, name)
 {
 }