public FixtureForUpdatingBatchsOfRecords() { // ARRANGE TableClient = GetTableClient(); Table = CreateTable(); var tasks = Enumerable.Range(0, 600).Select(i => { var op = TableOperation.Insert(new TestingEntity("partitionKey", Guid.NewGuid().ToString(), Guid.NewGuid().ToString())); return Table.ExecuteAsync(op); }); Task.WhenAll(tasks).Wait(); var tableQuery = new TableQuery<TestingEntity>().Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, "partitionKey")); var subject = new TsSet<TestingEntity>(new TsTable<TestingEntity>(Table)); // ACT Result = subject.BatchUpdateAsync( tableQuery, entities => { entities.ForEach(e => e.MyProperty = "Test"); }).Result; }
public FixtureForUpdatingBatchsOfRecords() { // ARRANGE var seed = Enumerable.Range(0, 600).Select(i => new TestingEntity("partitionKey", Guid.NewGuid().ToString(), Guid.NewGuid().ToString())); var tableQuery = new TableQuery<TestingEntity>().Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, "partitionKey")); _fakeTsTable = new FakeTsTable<TestingEntity>(seed); var subject = new TsSet<TestingEntity>(_fakeTsTable); // ACT Result = subject.BatchUpdateAsync( tableQuery, entities => { entities.ForEach(e => e.MyProperty = "Test"); }).Result; }