Should all table storage requests share the CloudTable reference

Viewed 93

As title suggests, I'm wondering whether all of my requests to table storage should share a reference to my CloudTable or not, I can't find documentation anywhere that covers this.

Example 1 (a CloudTable per request):

 public async Task MakeTableStorageRequest()
        {
                var operation = TableOperation.InsertOrMerge(...);
                var myTableReference = _cloudTableClient.GetTableReference(TableReference);
                await cloudTable.ExecuteAsync(insertOrMergeOp).ConfigureAwait(false);
        }

Example 2 (a CloudTable (singleton?) constructed once and shared):

public MyClass()
{
  ...
  _cloudTableRef = _cloudTableClient.GetTableReference("Some Table");
}

 public async Task MakeTableStorageRequest()
        {
                var operation = TableOperation.InsertOrMerge(...);
                await _cloudTableRef .ExecuteAsync(insertOrMergeOp).ConfigureAwait(false);
        }
1 Answers
Related