Strong typed related pages

Volodymyr Rets asked on December 23, 2018 19:13

Hello guys.

I ran into such a problem. I need to return strictly typed related pages. I use pages data type. Example, some page type (Article) has many Videos. How can I receive it in MVC? GetRelatedDocuments returns IEnumerable<TreeNode>, but i need IEnumerable<PageType>. There is no way to convert MultiDocumentQuery to DocumentQuery<T>? Thank you.

Recent Answers

Dražen Janjiček answered on December 24, 2018 10:29

Which makes sense if you think about it. The MultiDoumentQuery can return results of different types, so there is no way it can cast everything in one turn to type of T. You would need to handle that yourself.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.