public async Task RemoveRangeRemoves() { // Arrange var addedList = new List <Dummy>(); foreach (var i in Enumerable.Range(0, 10)) { var id = Guid.NewGuid().ToString(); var addedDummy = new Dummy { Id = id, Name = "Test " + i }; await _dummyStore.AddAsync(addedDummy); addedList.Add(addedDummy); } // Act var result = await _dummyStore.RemoveRangeAsync(addedList); // Assert Assert.True(result.IsSuccess); Assert.Empty(result.FailedEntities); }
public async Task DeleteAllByUserIdAsync(Guid userId) { var flatForRentAnnouncementPreferences = await _cosmosStore.Query().Where(x => x.UserId == userId).ToListAsync(); var removeResult = await _cosmosStore.RemoveRangeAsync(flatForRentAnnouncementPreferences); if (!removeResult.IsSuccess) { throw new DeleteManyFailureException(); } }
public async Task Clear() { var all = await GetAll(); await CosmosStore.RemoveRangeAsync(all); }