public void AddNewItem(string tableName, TableItem tableItem) { GenericTableEntity genericTableEntity = GenericTableEntity.HydrateFrom(tableItem); var operation = TableOperation.Insert(genericTableEntity); _operations.Enqueue(new ExecutableTableOperation(tableName, operation, TableOperationType.Insert, tableItem.PartitionKey, tableItem.RowKey)); }
public void Upsert(string tableName, TableItem tableItem) { // Upsert does not use an ETag (If-Match header) - http://msdn.microsoft.com/en-us/library/windowsazure/hh452242.aspx GenericTableEntity genericTableEntity = GenericTableEntity.HydrateFrom(tableItem); var operation = TableOperation.InsertOrReplace(genericTableEntity); _operations.Enqueue(new ExecutableTableOperation(tableName, operation, TableOperationType.InsertOrReplace, tableItem.PartitionKey, tableItem.RowKey)); }
public void DeleteItem(string tableName, TableItem tableItem, ConflictHandling conflictHandling) { var genericTableEntity = GenericTableEntity.HydrateFrom(tableItem); if (ShouldForceOverwrite(conflictHandling, genericTableEntity)) { genericTableEntity.ETag = "*"; } var operation = TableOperation.Delete(genericTableEntity); _operations.Enqueue(new ExecutableTableOperation(tableName, operation, TableOperationType.Delete, tableItem.PartitionKey, tableItem.RowKey)); }