/// <inheritdoc />
        public async Task <int> CountAsync <TEntity>(Expression <Func <TEntity, bool> > func, CancellationToken cancellation)
            where TEntity : TableEntity, new()
        {
            if (func == null)
            {
                throw new ArgumentNullException(nameof(func));
            }

            var query = TableQueryExtensions.Where(Query <TEntity>(), func);

            return(await CountAsync(query, cancellation));
        }
        /// <inheritdoc />

        public IAsyncEnumerable <TEntity> QueryAsync <TEntity>(
            Expression <Func <TEntity, bool> > func,
            CancellationToken token = default)
            where TEntity : TableEntity, new()
        {
            if (func == null)
            {
                throw new ArgumentNullException(nameof(func));
            }

            var query = TableQueryExtensions.Where(Query <TEntity>(), func);

            return(ExecuteQueryAsync(query, token));
        }
        /// <inheritdoc />

        public async Task <TableQuerySegment <TEntity> > QuerySegmentedAsync <TEntity>(
            Expression <Func <TEntity, bool> > func,
            int segmentSize = 10,
            TableContinuationToken token   = null,
            CancellationToken cancellation = default)
            where TEntity : TableEntity, new()
        {
            if (func == null)
            {
                throw new ArgumentNullException(nameof(func));
            }

            var query = TableQueryExtensions.Where(Query <TEntity>(), func);

            query.TakeCount = segmentSize;

            var table         = GetTable <TEntity>();
            var requestOption = new TableRequestOptions();
            var context       = new OperationContext();

            return(await table.ExecuteQuerySegmentedAsync(query, token, requestOption, context, cancellation)
                   .ConfigureAwait(false));
        }