public async Task <IEnumerable <PredictionDto> > HandleAsync(GetAllPredictionsRequest request) { IQueryable <PredictionEntity> query = _db.Predictions.OrderBy(e => e.Id); if (request.Take > 0) { query = query .Skip(request.Skip) .Take(request.Take); } var result = (await query .ToListAsync() .ConfigureAwait(false)).Select(Mapper.Map <PredictionDto>); return(result); }
public async Task <IEnumerable <PredictionDto> > Get([FromUri] GetAllPredictionsRequest request) { return(await _mediator.ExecuteAsync(request).ConfigureAwait(false)); }