public IndexSortAndFilterTest()
        {
            _tempFile   = new TempFile();
            _database   = new LiteDatabaseAsync(_tempFile.Filename);
            _collection = _database.GetCollection <Item>("items");

            var task1 = _collection.UpsertAsync(new Item()
            {
                Id = "C", Value = "Value 1"
            });
            var task2 = _collection.UpsertAsync(new Item()
            {
                Id = "A", Value = "Value 2"
            });
            var task3 = _collection.UpsertAsync(new Item()
            {
                Id = "B", Value = "Value 1"
            });

            Task.WaitAll(task1, task2, task3);

            var task4 = _collection.EnsureIndexAsync("idx_value", x => x.Value);

            task4.Wait();
        }
Beispiel #2
0
        public Person_Tests()
        {
            this.local = DataGen.Person().ToArray();

            _db         = new LiteDatabaseAsync(":memory:");
            _collection = _db.GetCollection <Person>("person");
            var task = _collection.InsertAsync(this.local);

            task.Wait();
        }