获取Episerver中某个页面继承的所有页面

Get all the pages inherited from the certain page in Episerver

有一个抽象基页

public abstract class BasePage : PageData

有一些页面继承自该页面

public class ChildPage : BasePage
public class ChildPage2 : BasePage

我需要检索从 BasePage 继承的所有页面。 在 PropertyCriteria 中,我只能使用 ChildPage 和 ChildPage2 通过 PageTypeID 进行搜索。所以这种方法不能解决我的问题

您最可行的选择是 1) 检索基础的所有页面(使用 GetChildrenGetDescendants,取决于内容结构)类型,或 2) 使用 Find.

Episerver Find 使这类事情变得微不足道,前提是您的站点实际使用了 Find。 :/

第三个(不推荐)选项是识别所有子类型并使用多个 FindPagesWithCriteria 调用,但这将是 slow。 FPWC 完全未缓存,并导致数据库调用。

就我个人而言,我从不将 FindPagesWithCriteria 用于某些管理功能以外的任何其他不处理呈现实际站点的功能。