How to retrieve the pages regardless of the channel

Hello, I have one requirement in which i have multiple channels and author is linking the pages of one channel to another one. so for that i need to retrieve the page url data. There are couple of options possible based on the Kentico docs

  1. use webPageUrlRetriever to retrieve the url by webpageguids

problem with this is in case of multiple guids i need to call this multiple times

  1. use ContentRetriever to retrieve the page related data by webpageguid

It allows multiple guids in single call but it needs channel name.

Can you suggest me a better alternatives??


Environment

Answers

Can you use the RetrieveAllPages and just omit the channel name?

var mixedPages = await _contentRetriever.RetrieveAllPages<IWebPageFieldsSource>(
    new RetrieveAllPagesParameters() {
        PathMatch = PathMatch.Children(path, nestingLevel: 1),
        IncludeUrlPath = true,
        LanguageName = lang,
        LinkedItemsMaxLevel = 1,
        UseLanguageFallbacks = true
    },
    query => query.Where(where => where.WhereIn(nameof(WebPageFields.WebPageItemGUID), myGuids)),
    RetrievalCacheSettings.CacheDisabled);

To response this discussion, you have to login first.