public async Task <bool> CreateIfNotExistsAsync(T item)
        {
            var res = await _table.CreateIfNotExistsAsync(item);

            await _cache.CreateIfNotExistsAsync(item);

            return(res);
        }
        public async Task AzureStorage_WithCache_Test()
        {
            var testEntity = GetTestEntity();

            var storage1 = new NoSqlTableInMemory <TestEntity>();

            Parallel.For(1, 10, i =>
            {
                storage1.CreateIfNotExistsAsync(testEntity).Wait();
            });

            var createdEntity = await storage1.GetDataAsync(testEntity.PartitionKey, testEntity.RowKey);

            Assert.IsNotNull(createdEntity);
        }
Beispiel #3
0
        public async Task CreateIfNotExistsAsync(T item)
        {
            await _table.CreateIfNotExistsAsync(item);

            await _cache.CreateIfNotExistsAsync(item);
        }