I'm migrating from Microsoft.Azure.Cosmos.Table to Azure.Data.Tables following this
with cosmos i had this method to insert/merge and return the inserted record
private async Task<OfficeSupplyEntity?> InsertOrMergeAsync(CloudTable table, OfficeSupplyEntity record)
{
var insertOrMergeOperation = TableOperation.InsertOrMerge(record);
var result = await table.ExecuteAsync(insertOrMergeOp);
var insertedCustomer = result?.Result as OfficeSupplyEntity;
return insertedCustomer;
}
now I want to convert this to use Azure.Data.Tables. But i'm not sure how to return the inserted record. here newRecord is seems to getting the type Azure.Response. How do I extract the inserted record.
private async Task<OfficeSupplyEntity?> InsertOrMergeAsync(TableClient table, OfficeSupplyEntity record)
{
var insertedCustomer = await table.UpsertEntityAsync(record);
//how to return inserted?
}
Help appreciated thanks