コード例 #1
0
        public void GlobalCleanupInMemory()
        {
            _fileMetaInMemoryCollection = null;

            DatabaseInstanceInMemory.DropCollection(nameof(FileMetaBase));
            DatabaseInstanceInMemory.Dispose();

            File.Delete(DatabasePath);
        }
コード例 #2
0
        public void CleanUpInMemory()
        {
            const string collectionName = nameof(FileMetaBase);

            var droppedCollectionIndexes = DatabaseInstanceInMemory.GetCollection(collectionName).GetIndexes().ToList();

            DatabaseInstanceInMemory.DropCollection(collectionName);

            foreach (var indexInfo in droppedCollectionIndexes)
            {
                DatabaseInstanceInMemory.Engine.EnsureIndex(collectionName, indexInfo.Field, indexInfo.Expression);
            }
        }