public async Task <MassiveRequestDto[]> GetList(MassiveRequestFilterDto filter) { _logger.LogDebug($"Calling getList MassiveRequest"); IQueryable <MassiveRequest> query = _dbCtx.MassiveRequests; if (filter.Id != Guid.Empty) { query = query.Where(x => x.Id == filter.Id); } var result = await query.OrderByDescending(x => x.LastExecution.HasValue?DateTime.MaxValue : x.LastExecution.Value).ToArrayAsync(); return(result.Select(x => x.ToDto()).ToArray()); }
public async Task <ActionResult <MassiveRequestDto[]> > GetList([FromQuery] MassiveRequestFilterDto filter) { var res = await _service.GetList(filter); return(res); }