public async Task <IList <DocumentDto> > GetDocumentsAsync(DocumentsFilterDto filterDto) { return(await _documentRepository.GetItemsQuery().Select(i => new DocumentDto { Id = i.Id, FileName = i.FileName, FileType = i.FileType, FileSize = i.FileSize, Company = i.Company, Manager = i.Manager, Application = i.Application, CreatedDate = i.CreatedDate, }).OrderBy(i => i.Id) .Skip(filterDto.Offset) .Take(filterDto.CountOnPage).ToListAsync()); }
public async Task <int> GetDocumentsCountAsync(DocumentsFilterDto filterDto) { return(await _documentRepository.GetItemsQuery().CountAsync()); }