Here is how I changed my approach to be async for anybody reading this question:
return await GetDbContext().Items .ProjectTo<DTO>(automapperConfigProvider) .Where() .Decompilâ€Œâ€‹eAsync() .OrderBy().ThenBy(...) .Skip(skip).Take(take) .ToListAsync();
In essence, I wanted the data server to handle all of the effort involved in projecting the dataset to DTO, running the query, and then selecting only a portion of the results based on paging information.
I looked into the
alternative that Jimmy Bogard brought up in his response to Darcy's response. However, I was use an AutoMapper.
I used it as a configuration provider for my mapping, but I was unable to convert it to an
. Thus, I decided against following Jimmy's advice.
There may be more approaches to solving this, but the code above worked for me.