/// <inheritdoc />
        public Task DeleteAsync(string index, string key)
        {
            if (string.IsNullOrEmpty(index))
            {
                throw new ArgumentException(nameof(index));
            }

            if (string.IsNullOrEmpty(key))
            {
                throw new ArgumentException(nameof(key));
            }

            if (!_options.IsCaseSensitive)
            {
                index = index.ToLowerInvariant();
            }

            var terms = CreateIndexTerms(index, false);

            return(terms.ParallelForEachAsync(async term =>
            {
                try
                {
                    await _tableStore.DeleteAsync(new DynamicTableEntity(term, key)
                    {
                        ETag = "*"
                    }).ConfigureAwait(false);
                }
                catch (StorageException e) when(e.RequestInformation.HttpStatusCode == 404)
                {
                    // do nothing
                }
            }));
        }
예제 #2
0
        /// <summary>
        /// Deletes the record asynchronously.
        /// </summary>
        /// <param name="record">The record.</param>
        /// <returns>Task.</returns>
        public Task DeleteAsync(T record)
        {
            var entity = CreateEntityWithEtag(record);

            return(_tableStore.DeleteAsync(entity));
        }