in performance/SqlTriggerBindingPerformance_Parallelization.cs [28:65]
public async Task MultiHost()
{
int firstId = 1;
int lastId = 90;
await this.WaitForProductChanges(
firstId,
lastId,
SqlChangeOperation.Insert,
() => { this.InsertProducts(firstId, lastId); return Task.CompletedTask; },
id => $"Product {id}",
id => id * 100,
this.GetBatchProcessingTimeout(firstId, lastId));
firstId = 1;
lastId = 60;
// All table columns (not just the columns that were updated) would be returned for update operation.
await this.WaitForProductChanges(
firstId,
lastId,
SqlChangeOperation.Update,
() => { this.UpdateProducts(firstId, lastId); return Task.CompletedTask; },
id => $"Updated Product {id}",
id => id * 100,
this.GetBatchProcessingTimeout(firstId, lastId));
firstId = 31;
lastId = 90;
// The properties corresponding to non-primary key columns would be set to the C# type's default values
// (null and 0) for delete operation.
await this.WaitForProductChanges(
firstId,
lastId,
SqlChangeOperation.Delete,
() => { this.DeleteProducts(firstId, lastId); return Task.CompletedTask; },
_ => null,
_ => 0,
this.GetBatchProcessingTimeout(firstId, lastId));
}