public async Task <ApiResponseDto <PaginatedTransactionsResponseDto> > GetTransactions(long userId, UserTransactionsParams userParams) { var transactions = await _transRepo.FindUsersTransaction(userParams, userId); if (transactions.TotalCount == 0) { return(new ApiResponseDto <PaginatedTransactionsResponseDto>(404, "No records found for this user", "Error fetching records", null)); } var transactionsToReturn = _mapper.Map <IEnumerable <TransactionAsListDto> >(transactions); var paginatedResponse = new PaginatedTransactionsResponseDto() { Transactions = transactionsToReturn, PageSize = transactions.PageSize, TotalPages = transactions.TotalPages, Count = transactions.TotalCount, CurrentPage = transactions.CurrentPage }; return(new ApiResponseDto <PaginatedTransactionsResponseDto>(200, "Success", null, paginatedResponse)); }