One way to solve this would be to index all assets (using EPiServer Find, Vulcan, vanilla elasticsearch, etc.) and then filter the documents by type and do skip/take.
The best part is that you don't even have to hit the episerver database to get a list of files that match your search criteria.
Thanks for reply Dejan!
But isnt that more for search functionality on web pages? Im building a function where I have a list of files and search for them by name in Epi and then replace binary for these files.
Performance-wise it's faster to retrieve content IDs from a search index than to get them from a database.
I just want to have a function where I fetch all assets of a certain type (pdf) and with a list of filenames. Can anyone point me in which direction I should be heading?