예제 #1
0
        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());
        }
예제 #2
0
        public async Task <ActionResult <MassiveRequestDto[]> > GetList([FromQuery] MassiveRequestFilterDto filter)
        {
            var res = await _service.GetList(filter);

            return(res);
        }