作用
方便在应用服务层对IQueryable
代码实现
var queryable = await _ordedrRepository.WithDetailAsync(x=>x.OrderItems);
queryable = queryable.WhereIf(inputDto.Guids.Any(),x=>inputDto.GuidIds.Contains(x.Id));
var pageQueryable = queryable.OrderBy().Skip().Take();
AsyncExecuter.ToListAsync();
var result = await AsyncExecuter.ToListAsync(pageQueryable,cancellationToken);
int totalCount = await AsyncExecuter.CountAsync(queryable,cancellationToken);
扩展
仓储层若要实现异步操作,可以直接使用.ToListAsync执行。
return await dbContext.Set<Order>().Include(x=>x.OrderItems).Where(x=>guids.Contains(x.Id))
.ToListAsync(cancellationToken);
标签:执行器,VNext,异步,await,AsyncExecuter,Abp,cancellationToken,queryable,ToListAsync
From: https://www.cnblogs.com/mingcore/p/18555328