Dot-Net

Azure 表儲存 InsertOrReplace 結果

  • August 17, 2016

在 Azure 表儲存上執行InsertOrReplace操作時,有沒有辦法確定實體是新插入的還是發生了替換?

TableOperation insertOperation = TableOperation.InsertOrReplace(entity);
TableResult result = table.Execute(insertOperation);

TableResult似乎沒有表明這一點。

InsertOrReplace將導致HttpStatusCode.NoContent成功插入或替換。這與 HTTP 略有偏差,表明HttpStatusCode.Created如果創建或插入某些內容,結果應該是 201 ( )。

引用自:https://stackoverflow.com/questions/22243398