示例#1
0
        /// <summary>
        /// Generates the query asynchronously and returns data in <typeparamref name="TResult"/>
        /// </summary>
        /// <param name="queryable">IQueryable</param>
        /// <param name="evaluator">IqueryableEvaluator</param>
        /// <param name="cancellationToken">CancelationToken</param>
        /// <returns>Data resulting from the query</returns>
        protected override async Task <IPagedQueryResult <TResult> > GenerateResultAsync(IQueryable <TEntity> queryable, IQueryableEvaluator evaluator, CancellationToken cancellationToken = default)
        {
            var materialized = this.Materialize(queryable);
            var values       = await evaluator.ToArrayAsync(materialized, cancellationToken);

            return(new PagedQueryResult <TResult>(values, this.Take, this.Skip, this.count));
        }