Beispiel #1
0
        public async Task <ErrorLogFilterDto> Search(ErrorLogFilterDto model)
        {
            var expression = GetSearchExpression(model);

            (var query, int totalCount) = await AuditUnitOfWork.ErrorLogRepository.GetPagedByFiltersAsync(
                model.PageNumber,
                model.jtPageSize.Value,
                expression,
                a => a.OrderByDescending(d => d.Date));

            model.Items = query.Select(errorLog => ErrorLogMapper.MapToDto(errorLog)).ToList();

            model.TotalCount = totalCount;

            return(model);
        }