public int Calculate_Pages_For_Null_Request_Parameters(int totalCount) { StorageItemsRequestParameters parameters = null; var sut = PagingManager.PrepareHeader(totalCount, parameters); return(sut.TotalPages); }
public int Calculate_Pages_Quantity_For_Default_Request_Parameters(int totalCount) { var parameters = new StorageItemsRequestParameters(); var sut = PagingManager.PrepareHeader(totalCount, parameters); return(sut.TotalPages); }
public async Task <(IEnumerable <FileItemDto> files, PaginationHeader header)> GetFilesForModerationAndHeaderAsync( StorageItemsRequestParameters itemsParams) { var parameters = mapper.Map <StorageItemsRequest>(itemsParams); var(files, totalCount) = await unitOfWork.StorageItems.GetAllFilesAsync(parameters); var pagingHeader = PagingManager.PrepareHeader(totalCount, itemsParams); var filesDto = mapper.Map <IEnumerable <StorageItem>, IEnumerable <FileItemDto> >(files); return(filesDto, pagingHeader); }
public async Task <(IEnumerable <FileItemDto> files, PaginationHeader header)> GetRecycledItemsAndHeaderAsync( UserDto userDto, StorageItemsRequestParameters itemsParams) { var user = mapper.Map <UserDto, User>(userDto); var parameters = mapper.Map <StorageItemsRequest>(itemsParams); var(files, totalCount) = await unitOfWork.StorageItems.GetRecycledFilesByUserAsync(user, parameters); var pagingHeader = PagingManager.PrepareHeader(totalCount, itemsParams); var filesDto = mapper.Map <IEnumerable <StorageItem>, IEnumerable <FileItemDto> >(files); return(filesDto, pagingHeader); }