Beispiel #1
0
        static TableOperation MakeDeleteOperation(Key key, string versionToDelete)
        {
            key = KeyEncode(key);
            var entity = AzureTableEntity.KeyOnly(key);

            entity.ETag = versionToDelete;
            return(TableOperation.Delete(entity));
        }
Beispiel #2
0
        public async Task <bool?> Delete(Key key)
        {
            CheckKey(key);

            key = KeyEncode(key);
            var entity = AzureTableEntity.KeyOnly(key);

            try
            {
                await this.table.ExecuteAsync(TableOperation.Delete(entity)).ConfigureAwait(false);

                return(true);
            }
            catch (StorageException e) when(e.RequestInformation.HttpStatusCode == (int)HttpStatusCode.NotFound)
            {
                return(false);
            }
        }