/// <summary>
        /// Delete all entities in the table.
        /// </summary>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public async Task DeleteAllAsync(CancellationToken cancellationToken = default)
        {
            var query = new TableQuery <TEntity>();

            var entities = await _table.ExecuteQueryAsync(query, cancellationToken);

            await FuncUtils.WhenAllAsync(e => DeleteIfExistsAsync(e, cancellationToken), entities);
        }
        /// <summary>
        /// Deletes all entities older than the supplied DateTime using an entity Timestamp.
        /// </summary>
        /// <param name="dateTime">Entities older than this DateTime will be deleted.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public async Task DeleteIfOlderThanAsync(DateTime dateTime, CancellationToken cancellationToken = default)
        {
            var filter = TableQuery.GenerateFilterConditionForDate(Timestamp, QueryComparisons.LessThan, dateTime);

            var query = new TableQuery <TEntity>()
                        .Where(filter);

            var entities = await _table.ExecuteQueryAsync(query, cancellationToken);

            await FuncUtils.WhenAllAsync(e => DeleteIfExistsAsync(e, cancellationToken), entities);
        }
        /// <summary>
        /// Delete an entity based on it's keys. If the entity does not exist then no exception will be thrown.
        /// </summary>
        /// <param name="partitionKey">Entity to delete partition key.</param>
        /// <param name="rowKey">Entity to delete row key.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public async Task DeleteIfExistsAsync(string partitionKey, string rowKey, CancellationToken cancellationToken = default)
        {
            var entity = await GetByKeysAsync(partitionKey, rowKey, cancellationToken);

            if (entity == null)
            {
                return;
            }

            await FuncUtils.SwallowNotFoundAsync(e => _table.DeleteAsync(e, cancellationToken), entity);
        }
 /// <summary>
 /// Delete a collection of entities. If any entity does not exist then no exception will be thrown.
 /// </summary>
 /// <param name="entities">Entities to delete.</param>
 /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
 /// <returns>The task object representing the asynchronous operation.</returns>
 /// <exception cref="T:System.ArgumentNullException"><paramref name="entities" /> is null.</exception>
 public Task DeleteIfExistsAsync(IEnumerable <TEntity> entities, CancellationToken cancellationToken = default)
 {
     return(FuncUtils.WhenAllAsync(e => DeleteIfExistsAsync(e, cancellationToken), entities));
 }
 /// <summary>
 /// Delete an entity. If the entity does not exist then no exception will be thrown.
 /// </summary>
 /// <param name="entity">Entity to delete.</param>
 /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
 /// <returns>The task object representing the asynchronous operation.</returns>
 /// <exception cref="T:System.ArgumentNullException"><paramref name="entity" /> is null.</exception>
 public Task DeleteIfExistsAsync(TEntity entity, CancellationToken cancellationToken = default)
 {
     return(FuncUtils.SwallowNotFoundAsync(e => _table.DeleteAsync(e, cancellationToken), entity));
 }
 /// <summary>
 /// Replace an existing entity. If the entity does not exist no exception is thrown.
 /// </summary>
 /// <param name="entity">Entity to replace.</param>
 /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
 /// <returns>The task object representing the asynchronous operation.</returns>
 /// <exception cref="T:System.ArgumentNullException"><paramref name="entity" /> is null.</exception>
 public Task ReplaceIfExistsAsync(TEntity entity, CancellationToken cancellationToken = default)
 {
     return(FuncUtils.SwallowNotFoundAsync(e => ReplaceAsync(e, cancellationToken), entity));
 }
 /// <summary>
 /// Replaces a collection of entities. If any entities do not exist then an exception is thrown.
 /// </summary>
 /// <param name="entities">Entities to replace.</param>
 /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
 /// <returns>The task object representing the asynchronous operation.</returns>
 /// <exception cref="T:System.ArgumentNullException"><paramref name="entities" /> is null.</exception>
 public Task ReplaceAsync(IEnumerable <TEntity> entities, CancellationToken cancellationToken = default)
 {
     return(FuncUtils.WhenAllAsync(e => ReplaceAsync(e, cancellationToken), entities));
 }