I have a delete operation that tries to delete various entries from an Azure storage table. Same table, same partition key.
private async Task RemoveNodesAsyc(string rowKey, string partitionId)
{
var result = this.GetNodes(this.table, rowKey, partitionId);
foreach (var node in result)
{
TableOperation deleteOperation = TableOperation.Delete(node);
TableResult resultDelete = await table.ExecuteAsync(deleteOperation);
}
}
I would like that in case I am deleting 50 rows, and the row number 47 fails, the changes were rolled back, so that I do not end up with 47 rows deleted and 3 rows hanging there in the ether.
Is there any way to do the above code in a transaction-like mode? I have been googling and I found for example this answer here, but Microsoft's documentation about group entity transactions talks about how to use the Rest API only. Is that functionality even available in C#? How can I say in plain C# something like start transaction, do operations, and commit/rollback by the end?