Ejemplo n.º 1
0
        public async Task InsertQuery(PersistenceLayerProvider layerProvider)
        {
            var queryRepository = layerProvider.ReadModelRepository;
            var testQuery       = new TestQuerry {
                UserName = "******"
            };
            await queryRepository.SaveQueryAsync(testQuery);

            var query = (await queryRepository.LoadAsync <TestQuerry>()).Value;

            Assert.AreEqual("Test", query.UserName);
        }
Ejemplo n.º 2
0
        public async Task InsertQuery_ConcurrencyProblem(PersistenceLayerProvider layerProvider)
        {
            var queryRepository = layerProvider.ReadModelRepository;
            var testQuery       = new TestQuerry {
                UserName = "******"
            };
            var testQuery2 = new TestQuerry {
                UserName = "******"
            };
            var save  = queryRepository.SaveQueryAsync(testQuery);
            var save2 = queryRepository.SaveQueryAsync(testQuery2);

            await Task.WhenAll(new List <Task> {
                save, save2
            });
        }