Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Table Storage InsertOrReplace result

When performing an InsertOrReplace operation on Azure Table Storage, is there any way to determine whether the entity was freshly inserted or if a replace occurred?

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

TableResult does not seem to indicate this.

like image 286
Dave New Avatar asked Mar 07 '14 06:03

Dave New


1 Answers

InsertOrReplace will result with HttpStatusCode.NoContent on a successful insert or replace. This is a slight deviation from HTTP that suggests 201 (HttpStatusCode.Created) should be the result if something is created or inserted.

like image 61
Peter Ritchie Avatar answered Oct 18 '22 11:10

Peter Ritchie